fix X_BEENTHERE segfault
authorPaul Mangan <paul@claws-mail.org>
Fri, 5 Oct 2001 14:55:22 +0000 (14:55 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 5 Oct 2001 14:55:22 +0000 (14:55 +0000)
ChangeLog.claws
src/compose.c

index 0603ceb9edeeab213beaa6d73d48190e8734f811..34d68cf899e6402ac7dcd6bde4f796babf777a24 100644 (file)
@@ -3,6 +3,9 @@
        * src/mainwindow.c, src/summaryview.c
                fix 'Message/Reply to all', broken in last commit
 
+       * src/compose.c
+               fix X_BEENTHERE seg fault, thanks to Alfons
+
 2001-10-04 [paul]      0.6.2claws18
 
        * src/compose.[ch], src/mainwindow.c
index 27569def53798c5d79680d495cc5c9427f818754..7dd6439991d150ffaceb4d0ad73b6e96072e64ba 100644 (file)
@@ -1246,7 +1246,7 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
        }
        if (hentry[H_X_MAILING_LIST].body != NULL) {
                /* this is good enough to parse debian-devel */
-               char * buf = g_malloc(strlen(hentry[H_X_MAILING_LIST].body));
+               char * buf = g_malloc(strlen(hentry[H_X_MAILING_LIST].body) + 1);
                g_return_val_if_fail(buf != NULL, -1 );
                if (1 == sscanf(hentry[H_X_MAILING_LIST].body, "<%[^>]>", buf))
                        compose->mailinglist = g_strdup(buf);
@@ -1256,7 +1256,7 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
        }
        if (hentry[H_X_BEENTHERE].body != NULL) {
                /* this is good enough to parse the sylpheed-claws lists */
-               char * buf = g_malloc(strlen(hentry[H_X_BEENTHERE].body));
+               char * buf = g_malloc(strlen(hentry[H_X_BEENTHERE].body) + 1);
                g_return_val_if_fail(buf != NULL, -1 );
                if (1 == sscanf(hentry[H_X_BEENTHERE].body, "%[^>]", buf))
                        compose->mailinglist = g_strdup(buf);