# HG changeset patch # User meillo@marmaro.de # Date 1307087247 -7200 # Node ID 29de6a1c4538bd7f51d8623a42dd258eae499444 # Parent 01d2f7a17bf0bbcbe89dc72a50964eec19f59795 Fixed an important bug with folded headers! g_strconcat() returns a *copy* of the string, but hdr->value still pointed to the old header (which probably was a memory leak, too). If the folded part had been quite small it was likely that the new string was at the same position as the old one, thus making everything go well. But if pretty long headers were folded several times it was likely that the new string was allocated somewhere else in memory, thus breaking things. In result mails to lots of recipients (folded header) were frequently only sent to the ones in the first line. Sorry for the inconvenience. diff -r 01d2f7a17bf0 -r 29de6a1c4538 src/accept.c --- a/src/accept.c Fri Jun 03 09:40:03 2011 +0200 +++ b/src/accept.c Fri Jun 03 09:47:27 2011 +0200 @@ -131,7 +131,11 @@ if (line1[0] == ' ' || line1[0] == '\t') { /* continuation of 'folded' header: */ if (hdr) { - hdr->header = g_strconcat(hdr->header, line1, NULL); + char* cp; + cp = g_strconcat(hdr->header, line1, NULL); + hdr->value = cp + (hdr->value - hdr->header); + free(hdr->header); + hdr->header = cp; } } else if (line1[0] == '\n') {