From: Kevin McCarthy Date: Fri, 5 Aug 2016 21:33:39 +0000 (-0700) Subject: Remove nonsensical size check in mutt_choose_charset() X-Git-Tag: neomutt-20160822~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb38636d30e6192b53c2d84498fdfbc9239f07b3;p=neomutt Remove nonsensical size check in mutt_choose_charset() The charsets parameter is being tokenized by the : delimeter. The checks against ENCWORD_LEN_MAX and ENCWORD_LEN_MIN make no sense, and appear to be the result of a large merge a very long time ago (changeset cb27682966d5). I can only guess where this check was supposed to be, but it certainly doesn't belong here. --- diff --git a/rfc2047.c b/rfc2047.c index c566bfcf0..850642545 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -140,11 +140,7 @@ char *mutt_choose_charset (const char *fromcode, const char *charsets, q = strchr (p, ':'); n = q ? q - p : strlen (p); - - if (!n || - /* Assume that we never need more than 12 characters of - encoded-text to encode a single character. */ - n > (ENCWORD_LEN_MAX - ENCWORD_LEN_MIN + 2 - 12)) + if (!n) continue; t = safe_malloc (n + 1);