From: Christoph Hohmann Date: Sun, 7 Sep 2003 00:19:16 +0000 (+0000) Subject: 0.9.4claws68 X-Git-Tag: gtk2_000~14 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=99c60244553548785dc9c176e58cabc9708b6830 0.9.4claws68 * src/compose.c o make sure we don't have any newlines in header values o check custom headers for spaces and newlines and ignore malformed header names --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 3ac702ba6..a7e17905e 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,10 @@ +2003-09-07 [christoph] 0.9.4claws68 + + * src/compose.c + o make sure we don't have any newlines in header values + o check custom headers for spaces and newlines and ignore + malformed header names + 2003-09-06 [christoph] 0.9.4claws67 * src/folder.c diff --git a/configure.ac b/configure.ac index 56584f3b2..acea07a9b 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=4 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=67 +EXTRA_VERSION=68 if test $EXTRA_VERSION -eq 0; then VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws else diff --git a/src/compose.c b/src/compose.c index a9c28b4e0..b8d99c5d1 100644 --- a/src/compose.c +++ b/src/compose.c @@ -4349,6 +4349,11 @@ static gint compose_write_headers(Compose *compose, FILE *fp, headerentry = ((ComposeHeaderEntry *)list->data); tmp = g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(headerentry->combo)->entry))); + if (strchr(tmp, ' ') != NULL || strchr(tmp, '\r') != NULL || strchr(tmp, '\n') != NULL) { + g_free(tmp); + continue; + } + if (!strstr(tmp, ":")) { headername_wcolon = g_strconcat(tmp, ":", NULL); headername = g_strdup(tmp); @@ -4359,6 +4364,8 @@ static gint compose_write_headers(Compose *compose, FILE *fp, g_free(tmp); headervalue = gtk_entry_get_text(GTK_ENTRY(headerentry->entry)); + subst_char(headervalue, '\r', ' '); + subst_char(headervalue, '\n', ' '); string = std_headers; while (*string != NULL) { headername_trans = prefs_common.trans_hdr ? gettext(*string) : *string; @@ -4370,8 +4377,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp, fprintf(fp, "%s %s\n", headername_wcolon, headervalue); g_free(headername); - g_free(headername_wcolon); - + g_free(headername_wcolon); } /* separator between header and body */ @@ -4391,6 +4397,8 @@ static void compose_convert_header(gchar *dest, gint len, gchar *src, if (len < 1) return; g_strchomp(src); + subst_char(src, '\n', ' '); + subst_char(src, '\r', ' '); conv_encode_header(dest, len, src, header_len, addr_field); }