]> granicus.if.org Git - mutt/commitdiff
detect failure to decode word and copy raw string instead; avoids calling strlen...
authorMichael Elkins <me@sigpipe.org>
Tue, 24 Aug 2010 23:40:08 +0000 (16:40 -0700)
committerMichael Elkins <me@sigpipe.org>
Tue, 24 Aug 2010 23:40:08 +0000 (16:40 -0700)
closes #2923

rfc2047.c

index 65528a9be4195e51951d0c3246e78e99eb211fc1..bdc7f2b2ecdad317e9673779ba848ac4854602a8 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -877,7 +877,11 @@ void rfc2047_decode (char **pd)
       }
     }
 
-    rfc2047_decode_word (d, p, dlen);
+    if (rfc2047_decode_word (d, p, dlen) == -1)
+    {
+      /* could not decode word, fall back to displaying the raw string */
+      strfcpy(d, p, dlen);
+    }
     found_encoded = 1;
     s = q;
     n = mutt_strlen (d);