2011-01-03 [colin] 3.7.8cvs25
authorColin Leroy <colin@colino.net>
Mon, 3 Jan 2011 19:11:00 +0000 (19:11 +0000)
committerColin Leroy <colin@colino.net>
Mon, 3 Jan 2011 19:11:00 +0000 (19:11 +0000)
* src/unmime.c
Fix bug #2299, "Incorrect handling of quoted printable coma
in headers". As this is really painful to fix by switching
the whole stuff to a list of headers tokens, we workaround
the problem by adding quotes around the encoded-word (making
it a quoted-string which continuity is already handled).

ChangeLog
PATCHSETS
configure.ac
src/unmime.c

index 4ea952e78c53e4b539267ea02fed827192c19104..6a6ff9b3f60e37b45405c9fc80f7079e8d3a9c25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-03 [colin]     3.7.8cvs25
+
+       * src/unmime.c
+               Fix bug #2299, "Incorrect handling of quoted printable coma
+               in headers". As this is really painful to fix by switching
+               the whole stuff to a list of headers tokens, we workaround
+               the problem by adding quotes around the encoded-word (making
+               it a quoted-string which continuity is already handled).
+
 2011-01-03 [colin]     3.7.8cvs24
 
        * src/procheader.c
 2011-01-03 [colin]     3.7.8cvs24
 
        * src/procheader.c
index bfa96953699ee8a01a26f11360ede640ad593f29..3d315571f47e6634c937fc240dffc3f904b13200 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.50.2.60 -r 1.50.2.61 src/compose.h;  ) > 3.7.8cvs22.patchset
 ( cvs diff -u -r 1.382.2.564 -r 1.382.2.565 src/compose.c;  ) > 3.7.8cvs23.patchset
 ( cvs diff -u -r 1.47.2.51 -r 1.47.2.52 src/procheader.c;  ) > 3.7.8cvs24.patchset
 ( cvs diff -u -r 1.50.2.60 -r 1.50.2.61 src/compose.h;  ) > 3.7.8cvs22.patchset
 ( cvs diff -u -r 1.382.2.564 -r 1.382.2.565 src/compose.c;  ) > 3.7.8cvs23.patchset
 ( cvs diff -u -r 1.47.2.51 -r 1.47.2.52 src/procheader.c;  ) > 3.7.8cvs24.patchset
+( cvs diff -u -r 1.8.2.14 -r 1.8.2.15 src/unmime.c;  ) > 3.7.8cvs25.patchset
index ec163f640d0dd15fbff6c71aec5ac964c0ddefe6..b227b76e77e35df7af54a540eb0b5294671cc952 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=24
+EXTRA_VERSION=25
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 0fe584059600373dcbf27fee7e5046edd55fcb8c..6abd31ebd94f2bb4ae339605ce6f7138ac0d2990 100644 (file)
@@ -114,6 +114,17 @@ gchar *unmime_header(const gchar *encoded_str)
                        continue;
                }
 
                        continue;
                }
 
+               /* An encoded word MUST not appear within a quoted string,
+                * so quoting that word after decoding should be safe.
+                * We check there are no quotes just to be sure. If there
+                * are, well, the comma won't pose a problem, probably.
+                */
+               if (strchr(decoded_text, ',') && !strchr(decoded_text, '"')) {
+                       gchar *tmp = g_strdup_printf("\"%s\"", decoded_text);
+                       g_free(decoded_text);
+                       decoded_text = tmp;
+               }
+
                /* convert to UTF-8 */
                conv_str = conv_codeset_strdup(decoded_text, charset, NULL);
                if (!conv_str || !g_utf8_validate(conv_str, -1, NULL)) {
                /* convert to UTF-8 */
                conv_str = conv_codeset_strdup(decoded_text, charset, NULL);
                if (!conv_str || !g_utf8_validate(conv_str, -1, NULL)) {