From e29c946c29afdb0bf89c5329fcf3038448d50e17 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 25 Aug 2018 15:41:44 +0200 Subject: Fix #60494: iconv_mime_decode does ignore special characters We must not ignore erroneous characters in mime headers, but rather let iconv_mime_decode() fail in this case, issuing the usual notice regarding illegal characters. --- ext/iconv/iconv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/iconv/iconv.c') diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index dd56ebadca..d759596d65 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1544,7 +1544,10 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st break; default: /* first letter of a non-encoded word */ - _php_iconv_appendc(pretval, *p1, cd_pl); + err = _php_iconv_appendc(pretval, *p1, cd_pl); + if (err != PHP_ICONV_ERR_SUCCESS) { + goto out; + } encoded_word = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { scan_stat = 12; -- cgit v1.2.1