From: Michael Elkins Date: Tue, 24 Aug 2010 23:40:08 +0000 (-0700) Subject: detect failure to decode word and copy raw string instead; avoids calling strlen... X-Git-Tag: mutt-1-5-21-rel~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0d19f317575d48de5575725e87fec04931389d5;p=mutt detect failure to decode word and copy raw string instead; avoids calling strlen() on uninitialized memory closes #2923 --- diff --git a/rfc2047.c b/rfc2047.c index 65528a9b..bdc7f2b2 100644 --- 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);