2005-01-03 [colin] 0.9.13cvs25.1
authorColin Leroy <colin@colino.net>
Mon, 3 Jan 2005 08:36:49 +0000 (08:36 +0000)
committerColin Leroy <colin@colino.net>
Mon, 3 Jan 2005 08:36:49 +0000 (08:36 +0000)
* src/pop.c
* src/pop.h
Sync with HEAD

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/pop.c
src/pop.h

index f86905059aede74d34c4928ab707211627714d78..b0b0150acf9fef58dbaf4959051b8a721f795dc7 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-03 [colin]     0.9.13cvs25.1
+
+       * src/pop.c
+       * src/pop.h
+               Sync with HEAD
+
 2005-01-03 [colin]     0.9.13cvs24.3
 
        * src/account.c
index 3edb378ece8b472d377e3617369e0fdaa09812fe..c9f7b050ba86b2e75ba8f924f47778b87ca7cd0f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.49.2.28 -r 1.49.2.29 src/procmime.c; ) > 0.9.13cvs24.1.patchset
 ( cvs diff -u -r 1.60.2.7 -r 1.60.2.8 src/prefs_actions.c; ) > 0.9.13cvs24.2.patchset
 ( cvs diff -u -r 1.61.2.18 -r 1.61.2.19 src/account.c; ) > 0.9.13cvs24.3.patchset
+( cvs diff -u -r 1.56.2.30 -r 1.56.2.31 src/pop.c; cvs diff -u -r 1.17.2.12 -r 1.17.2.13 src/pop.h; ) > 0.9.13cvs25.1.patchset
index 2bd097307ad8740516fd05a69e04c6002bba0ad2..6183d382d9de1f2d79fe3f94c27ee6b641947965 100644 (file)
@@ -11,9 +11,9 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=24
+EXTRA_VERSION=25
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.3
+EXTRA_GTK2_VERSION=.1
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index b4ef2ea7e9aefb0d35381209d8aabf9c1396a4bd..f4a7f167a2291893319d92b91abb69173c72facc 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -339,13 +339,18 @@ static gint pop3_retr_recv(Pop3Session *session, const gchar *data, guint len)
        gint drop_ok;
        MailReceiveData mail_receive_data;
 
-       mail_receive_data.session = session;
-       mail_receive_data.data = g_strndup(data, len);
+       /* NOTE: we allocate a slightly larger buffer with a zero terminator
+        * because some plugins may think that it has a C string. */ 
+       mail_receive_data.session  = session;
+       mail_receive_data.data     = g_new0(gchar, len + 1);
+       mail_receive_data.data_len = len;
+       memcpy(mail_receive_data.data, data, len); 
+       
        hooks_invoke(MAIL_RECEIVE_HOOKLIST, &mail_receive_data);
 
        file = get_tmp_file();
-       if (pop3_write_msg_to_file(file, mail_receive_data.data,
-               strlen(mail_receive_data.data), NULL) < 0) {
+       if (pop3_write_msg_to_file(file, mail_receive_data.data, 
+                                  mail_receive_data.data_len, NULL) < 0) {
                g_free(file);
                g_free(mail_receive_data.data);
                session->error_val = PS_IOERR;
@@ -403,8 +408,13 @@ static gint pop3_top_recv(Pop3Session *session, const gchar *data, guint len)
        MailReceiveData mail_receive_data;
        gchar *partial_notice = NULL;
        
-       mail_receive_data.session = session;
-       mail_receive_data.data = g_strndup(data, len);
+       /* NOTE: we allocate a slightly larger buffer with a zero terminator
+        * because some plugins may think that it has a C string. */ 
+       mail_receive_data.session  = session;
+       mail_receive_data.data     = g_new0(gchar, len + 1);
+       mail_receive_data.data_len = len;
+       memcpy(mail_receive_data.data, data, len);
+       
        hooks_invoke(MAIL_RECEIVE_HOOKLIST, &mail_receive_data);
 
        partial_notice = g_strdup_printf("SC-Marked-For-Download: 0\n"
@@ -418,7 +428,8 @@ static gint pop3_top_recv(Pop3Session *session, const gchar *data, guint len)
                                         session->msg[session->cur_msg].size);
        file = get_tmp_file();
        if (pop3_write_msg_to_file(file, mail_receive_data.data,
-               strlen(mail_receive_data.data), partial_notice) < 0) {
+                                  mail_receive_data.data_len,  
+                                  partial_notice) < 0) {
                g_free(file);
                g_free(mail_receive_data.data);
                session->error_val = PS_IOERR;
index 8b4d9b1f596855566ed0d835c60f84d47f96b909..a63af6f6ea1ba70ad9d72031041aa60e0a1de9f2 100644 (file)
--- a/src/pop.h
+++ b/src/pop.h
@@ -40,6 +40,7 @@ struct _MailReceiveData
 {
        Pop3Session *session;
        char *data;
+       guint data_len;
 };
 typedef struct _MailReceiveData        MailReceiveData;