* src/pop.c
* src/pop.h
Add data_len member, because we can get NULs from network
Patch by Alfons
+2005-01-03 [colin] 0.9.13cvs25
+
+ * src/pop.c
+ * src/pop.h
+ Add data_len member, because we can get NULs from network
+ Patch by Alfons
+
2005-01-01 [colin] 0.9.13cvs24
* src/procmime.c
2005-01-01 [colin] 0.9.13cvs24
* src/procmime.c
( cvs diff -u -r 1.452 -r 1.453 ChangeLog; cvs diff -u -r 1.447 -r 1.448 ChangeLog.jp; cvs diff -u -r 1.54 -r 1.55 NEWS; cvs diff -u -r 1.76 -r 1.77 src/account.c; ) > 0.9.13cvs22.patchset
( cvs diff -u -r 1.77 -r 1.78 src/account.c; ) > 0.9.13cvs23.patchset
( cvs diff -u -r 1.101 -r 1.102 src/procmime.c; ) > 0.9.13cvs24.patchset
( cvs diff -u -r 1.452 -r 1.453 ChangeLog; cvs diff -u -r 1.447 -r 1.448 ChangeLog.jp; cvs diff -u -r 1.54 -r 1.55 NEWS; cvs diff -u -r 1.76 -r 1.77 src/account.c; ) > 0.9.13cvs22.patchset
( cvs diff -u -r 1.77 -r 1.78 src/account.c; ) > 0.9.13cvs23.patchset
( cvs diff -u -r 1.101 -r 1.102 src/procmime.c; ) > 0.9.13cvs24.patchset
+( cvs diff -u -r 1.72 -r 1.73 src/pop.c; cvs diff -u -r 1.22 -r 1.23 src/pop.h; ) > 0.9.13cvs25.patchset
MICRO_VERSION=13
INTERFACE_AGE=0
BINARY_AGE=0
MICRO_VERSION=13
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_RELEASE=
if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
EXTRA_RELEASE=
if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
gint drop_ok;
MailReceiveData mail_receive_data;
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();
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;
g_free(file);
g_free(mail_receive_data.data);
session->error_val = PS_IOERR;
MailReceiveData mail_receive_data;
gchar *partial_notice = NULL;
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"
hooks_invoke(MAIL_RECEIVE_HOOKLIST, &mail_receive_data);
partial_notice = g_strdup_printf("SC-Marked-For-Download: 0\n"
session->msg[session->cur_msg].size);
file = get_tmp_file();
if (pop3_write_msg_to_file(file, mail_receive_data.data,
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;
g_free(file);
g_free(mail_receive_data.data);
session->error_val = PS_IOERR;
{
Pop3Session *session;
char *data;
{
Pop3Session *session;
char *data;
};
typedef struct _MailReceiveData MailReceiveData;
};
typedef struct _MailReceiveData MailReceiveData;