ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.25,1.26


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.25,1.26
Date: Tue, 14 Jan 2003 10:12:15 -0500

Update of /cvsroot/ayttm/ayttm/modules/msn2
In directory subversions:/tmp/cvs-serv20834/modules/msn2

Modified Files:
        msn.C 
Log Message:
try to fight buffer overflows & read() timeouts


Index: msn.C
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.C,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- msn.C       14 Jan 2003 12:03:11 -0000      1.25
+++ msn.C       14 Jan 2003 15:12:13 -0000      1.26
@@ -657,13 +657,13 @@
        msg->font = NULL;
        msg->colour = NULL;
        msg->content = "text/plain; charset=UTF-8";
-        if(strlen(mess)>2000)
+        if(strlen(mess)>1100)
         {
           char buf[1024];
-          snprintf(buf, 1024, "Warning - your last message was too long for 
the MSN service. The last %d characters were not sent.", strlen(mess)-2000);
+          snprintf(buf, 1024, "Warning - your last message was too long for 
the MSN service. The last %d characters were not sent.", strlen(mess)-1100);
           do_error_dialog(buf, "MSN: Message truncated");
         }
-       msg->body = g_strndup(StrToUtf8(mess), 1998);
+       msg->body = g_strndup(StrToUtf8(mess), 1098);
 
         eb_msn_local_account_data * mlad;
        mlad = (eb_msn_local_account_data *)from->protocol_local_account_data;
@@ -1107,7 +1107,13 @@
 {
        message * msg=new message;
        msg->header=NULL;
-       msg->body=g_strndup(StrToUtf8(mess), 1998);
+        if(strlen(mess)>1100)
+        {
+          char buf[1024];
+          snprintf(buf, 1024, "Warning - your last message was too long for 
the MSN service. The last %d characters were not sent.", strlen(mess)-1100);
+          do_error_dialog(buf, "MSN: Message truncated");
+        }
+       msg->body = g_strndup(StrToUtf8(mess), 1098);
        msg->font=NULL;
        msg->content=strdup("text/plain; charset=UTF-8");
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]