0.9.4claws68
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 7 Sep 2003 00:19:16 +0000 (00:19 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 7 Sep 2003 00:19:16 +0000 (00:19 +0000)
* 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

ChangeLog.claws
configure.ac
src/compose.c

index 3ac702b..a7e1790 100644 (file)
@@ -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
index 56584f3..acea07a 100644 (file)
@@ -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
index a9c28b4..b8d99c5 100644 (file)
@@ -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);
 }