From d58d0c9b8c8602c2ed1511594eaecdbeedd26d35 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Fri, 5 Aug 2016 14:33:39 -0700 Subject: [PATCH] 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. --- rfc2047.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rfc2047.c b/rfc2047.c index c566bfcf..85064254 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); -- 2.50.1