From: Paul Mangan Date: Fri, 4 Mar 2005 10:02:22 +0000 (+0000) Subject: 2005-03-04 [paul] 1.0.1cvs21 X-Git-Tag: rel_1_0_3~2 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=5865efce5e3fd72a381db5973974c01e4a40c82c;hp=6fddfe6b58e646c4d8135a8d05f3fd3d3d99cf9c 2005-03-04 [paul] 1.0.1cvs21 * ChangeLog * ChangeLog.jp * src/addrharvest.c * src/codeconv.c * src/codeconv.h * src/compose.c * src/procmime.c sync with main 1.0.3 see ChangeLog 2005-02-28, 2005-03-02, and 2005-03-04 --- diff --git a/ChangeLog b/ChangeLog index 8d516c0ed..550b06e46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2005-03-04 + + * version 1.0.3 + +2005-03-04 + + * src/codeconv.[ch]: removed conv_unmime_header_overwrite() because + it had introduced buffer overflow. + * src/compose.c: compose_parse_header(): don't use + conv_unmime_header_overwrite() which introduced buffer overflow. + +2005-03-02 + + * src/compose.c: compose_destroy(): destroy paned only if it's not + attached to window. Fixed memory leak of popup menu. + +2005-02-28 + + * version 1.0.2 + +2005-02-28 + + * src/compose.c: compose_parse_header(): generate References: from + In-Reply-To: even if the parent message doesn't have Message-Id: + (thanks to mori). + +2005-02-24 + + * src/compose.c: compose_write_attach(): force transfer encoding to + protect trailing spaces for PGP signing. + 2005-02-10 * src/compose.c: compose_write_file(): force transfer encoding to diff --git a/ChangeLog.claws b/ChangeLog.claws index 44232c379..f9ac2b978 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,15 @@ +2005-03-04 [paul] 1.0.1cvs21 + + * ChangeLog + * ChangeLog.jp + * src/addrharvest.c + * src/codeconv.c + * src/codeconv.h + * src/compose.c + * src/procmime.c + sync with main 1.0.3 + see ChangeLog 2005-02-28, 2005-03-02, and 2005-03-04 + 2005-02-27 [paul] 1.0.1cvs20 * src/messageview.c diff --git a/ChangeLog.jp b/ChangeLog.jp index 096a38756..d7acb647f 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,35 @@ +2005-03-04 + + * version 1.0.3 + +2005-03-04 + + * src/codeconv.[ch]: ¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤·¤Æ¤¤¤¿ + conv_unmime_header_overwrite() ¤òºï½ü¡£ + * src/compose.c: compose_parse_header(): ¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ò + µ¯¤³¤¹ conv_unmime_header_overwrite() ¤ò»ÈÍѤ·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£ + +2005-03-02 + + * src/compose.c: compose_destroy(): paned ¤¬¥¦¥£¥ó¥É¥¦¤ËÉÕ°¤·¤Æ + ¤¤¤Ê¤¤¾ì¹ç¤Î¤ß destroy ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼¤¬ + ¥á¥â¥ê¥ê¡¼¥¯¤·¤Æ¤¤¤¿¤Î¤ò½¤Àµ¡£ + +2005-02-28 + + * version 1.0.2 + +2005-02-28 + + * src/compose.c: compose_parse_header(): ¿Æ¥á¥Ã¥»¡¼¥¸¤¬ Message-Id: + ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â In-Reply-To: ¤«¤é References: ¤òÀ¸À®¤¹¤ë + ¤è¤¦¤Ë¤·¤¿(mori ¤µ¤ó thanks)¡£ + +2005-02-24 + + * src/compose.c: compose_write_attach(): PGP ½ð̾¤Î¤¿¤á¤Ë¹ÔËö¤Î¶õÇò¤ò + Êݸ¤ë¤¿¤á¤ËžÁ÷¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò¶¯À©¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£ + 2005-02-10 * src/compose.c: compose_write_file(): PGP ½ð̾¤Î¤¿¤á¤Ë¹ÔËö¤Î¶õÇò¤ò diff --git a/PATCHSETS b/PATCHSETS index 5350e3641..4a957efef 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -258,3 +258,4 @@ ( cvs diff -u -r 1.134 -r 1.135 src/messageview.c; ) > 1.0.1cvs18.patchset ( cvs diff -u -r 1.123 -r 1.124 src/prefs_account.c; cvs diff -u -r 1.63 -r 1.64 src/prefs_folder_item.c; cvs diff -u -r 1.20 -r 1.21 src/gtk/prefswindow.c; cvs diff -u -r 1.9 -r 1.10 src/gtk/prefswindow.h; ) > 1.0.1cvs19.patchset ( cvs diff -u -r 1.135 -r 1.136 src/messageview.c; ) > 1.0.1cvs20.patchset +( cvs diff -u -r 1.458 -r 1.459 ChangeLog; cvs diff -u -r 1.453 -r 1.454 ChangeLog.jp; cvs diff -u -r 1.7 -r 1.8 src/addrharvest.c; cvs diff -u -r 1.74 -r 1.75 src/codeconv.c; cvs diff -u -r 1.16 -r 1.17 src/codeconv.h; cvs diff -u -r 1.479 -r 1.480 src/compose.c; cvs diff -u -r 1.105 -r 1.106 src/procmime.c; ) > 1.0.1cvs21.patchset diff --git a/configure.ac b/configure.ac index 597fdfbf9..e8d25bd27 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=0 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=20 +EXTRA_VERSION=21 EXTRA_RELEASE= if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then diff --git a/src/addrharvest.c b/src/addrharvest.c index e4cb2415c..2c00a58a6 100644 --- a/src/addrharvest.c +++ b/src/addrharvest.c @@ -513,6 +513,7 @@ static void addrharvest_parse_address( AddressCache *cache, const gchar *hdrBuf ) { gchar buffer[ ADDR_BUFFSIZE + 2 ]; + gchar buf[ADDR_BUFFSIZE]; const gchar *bp; const gchar *ep; gchar *atCh, *email, *name; @@ -555,7 +556,8 @@ static void addrharvest_parse_address( } else { name = buffer; - conv_unmime_header_overwrite(name); + conv_unmime_header(buf, sizeof(buf), name, + NULL); } /* Insert into address book */ diff --git a/src/codeconv.c b/src/codeconv.c index baba8b4da..d177f743c 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2004 Hiroyuki Yamamoto + * Copyright (C) 1999-2005 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1453,29 +1453,6 @@ const gchar *conv_get_current_locale(void) return cur_locale; } -void conv_unmime_header_overwrite(gchar *str) -{ - gchar *buf; - gint buflen; - CharSet cur_charset; - - g_return_if_fail(str != NULL); - - cur_charset = conv_get_current_charset(); - - if (cur_charset == C_EUC_JP) { - buflen = strlen(str) * 2 + 1; - Xalloca(buf, buflen, return); - conv_anytodisp(buf, buflen, str); - unmime_header(str, buf); - } else { - buflen = strlen(str) + 1; - Xalloca(buf, buflen, return); - unmime_header(buf, str); - strncpy2(str, buf, buflen); - } -} - void conv_unmime_header(gchar *outbuf, gint outlen, const gchar *str, const gchar *charset) { diff --git a/src/codeconv.h b/src/codeconv.h index e08a2a811..5f8ddaab1 100644 --- a/src/codeconv.h +++ b/src/codeconv.h @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2004 Hiroyuki Yamamoto + * Copyright (C) 1999-2005 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -216,7 +216,6 @@ gboolean conv_is_multibyte_encoding (CharSet encoding); const gchar *conv_get_current_locale (void); -void conv_unmime_header_overwrite (gchar *str); void conv_unmime_header (gchar *outbuf, gint outlen, const gchar *str, diff --git a/src/compose.c b/src/compose.c index 6e94b5e5a..bc19e2a2a 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1609,6 +1609,7 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo) }; FILE *fp; + gchar buf[BUFFSIZE]; g_return_val_if_fail(msginfo != NULL, -1); @@ -1617,13 +1618,16 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo) fclose(fp); if (hentry[H_REPLY_TO].body != NULL) { - conv_unmime_header_overwrite(hentry[H_REPLY_TO].body); - compose->replyto = hentry[H_REPLY_TO].body; + conv_unmime_header(buf, sizeof(buf), hentry[H_REPLY_TO].body, + NULL); + compose->replyto = g_strdup(buf); + g_free(hentry[H_REPLY_TO].body); hentry[H_REPLY_TO].body = NULL; } if (hentry[H_CC].body != NULL) { - conv_unmime_header_overwrite(hentry[H_CC].body); - compose->cc = hentry[H_CC].body; + conv_unmime_header(buf, sizeof(buf), hentry[H_CC].body, NULL); + compose->cc = g_strdup(buf); + g_free(hentry[H_CC].body); hentry[H_CC].body = NULL; } if (hentry[H_REFERENCES].body != NULL) { @@ -1638,20 +1642,22 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo) } if (hentry[H_BCC].body != NULL) { if (compose->mode == COMPOSE_REEDIT) { - conv_unmime_header_overwrite(hentry[H_BCC].body); - compose->bcc = hentry[H_BCC].body; - } else - g_free(hentry[H_BCC].body); + conv_unmime_header + (buf, sizeof(buf), hentry[H_BCC].body, NULL); + compose->bcc = g_strdup(buf); + } + g_free(hentry[H_BCC].body); hentry[H_BCC].body = NULL; } if (hentry[H_NEWSGROUPS].body != NULL) { - conv_unmime_header_overwrite(hentry[H_NEWSGROUPS].body); compose->newsgroups = hentry[H_NEWSGROUPS].body; hentry[H_NEWSGROUPS].body = NULL; } if (hentry[H_FOLLOWUP_TO].body != NULL) { - conv_unmime_header_overwrite(hentry[H_FOLLOWUP_TO].body); - compose->followup_to = hentry[H_FOLLOWUP_TO].body; + conv_unmime_header + (buf, sizeof(buf), hentry[H_FOLLOWUP_TO].body, NULL); + compose->followup_to = g_strdup(buf); + g_free(hentry[H_FOLLOWUP_TO].body); hentry[H_FOLLOWUP_TO].body = NULL; } if (hentry[H_LIST_POST].body != NULL) { @@ -1687,13 +1693,17 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo) compose->priority = priority; } - if (compose->mode == COMPOSE_REEDIT && msginfo->inreplyto) - compose->inreplyto = g_strdup(msginfo->inreplyto); - else if (compose->mode != COMPOSE_REEDIT && - msginfo->msgid && *msginfo->msgid) { + if (compose->mode == COMPOSE_REEDIT) { + if (msginfo->inreplyto && *msginfo->inreplyto) + compose->inreplyto = g_strdup(msginfo->inreplyto); + return 0; + } + + if (msginfo->msgid && *msginfo->msgid) compose->inreplyto = g_strdup(msginfo->msgid); - if (!compose->references) { + if (!compose->references) { + if (msginfo->msgid && *msginfo->msgid) { if (msginfo->inreplyto && *msginfo->inreplyto) compose->references = g_strdup_printf("<%s>\n\t<%s>", @@ -1703,6 +1713,10 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo) compose->references = g_strconcat("<", msginfo->msgid, ">", NULL); + } else if (msginfo->inreplyto && *msginfo->inreplyto) { + compose->references = + g_strconcat("<", msginfo->inreplyto, ">", + NULL); } } @@ -5309,7 +5323,9 @@ static void compose_destroy(Compose *compose) prefs_common.compose_width = compose->scrolledwin->allocation.width; prefs_common.compose_height = compose->window->allocation.height; - gtk_widget_destroy(compose->paned); + if (!compose->paned->parent) + gtk_widget_destroy(compose->paned); + gtk_widget_destroy(compose->popupmenu); toolbar_destroy(compose->toolbar); g_free(compose->toolbar); diff --git a/src/procmime.c b/src/procmime.c index 60cf82225..0cc984416 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -1223,6 +1223,7 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo) {NULL, NULL, FALSE}}; guint content_start, i; FILE *fp; + gchar buf[BUFFSIZE]; gint mime_major, mime_minor; procmime_decode_content(mimeinfo); @@ -1235,11 +1236,14 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo) fseek(fp, mimeinfo->offset, SEEK_SET); procheader_get_header_fields(fp, hentry); if (hentry[0].body != NULL) - conv_unmime_header_overwrite(hentry[0].body); + conv_unmime_header(buf, sizeof(buf), hentry[0].body, + NULL); if (hentry[2].body != NULL) - conv_unmime_header_overwrite(hentry[2].body); + conv_unmime_header(buf, sizeof(buf), hentry[2].body, + NULL); if (hentry[4].body != NULL) - conv_unmime_header_overwrite(hentry[4].body); + conv_unmime_header(buf, sizeof(buf), hentry[4].body, + NULL); content_start = ftell(fp); fclose(fp); @@ -1327,11 +1331,14 @@ void procmime_parse_multipart(MimeInfo *mimeinfo) } procheader_get_header_fields(fp, hentry); if (hentry[0].body != NULL) - conv_unmime_header_overwrite(hentry[0].body); + conv_unmime_header(buf, sizeof(buf), hentry[0].body, + NULL); if (hentry[2].body != NULL) - conv_unmime_header_overwrite(hentry[2].body); + conv_unmime_header(buf, sizeof(buf), hentry[2].body, + NULL); if (hentry[4].body != NULL) - conv_unmime_header_overwrite(hentry[4].body); + conv_unmime_header(buf, sizeof(buf), hentry[4].body, + NULL); lastoffset = ftell(fp); } }