From 153e292e108f2fcd411ae75a00d3814987ccf17d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 4 Sep 2018 05:07:43 +0200 Subject: [PATCH] Escape trigraph sequence ??= is a trigraph for #, so it needs to be escaped. To stay consistent I'm escaping all question marks in this literal, even though one of the latter two would suffice. --- ext/iconv/iconv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 38a775c9a8..d1b28c122d 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1224,7 +1224,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn do { size_t prev_in_left; size_t out_size; - size_t encoded_word_min_len = sizeof("=??X??=")-1 + out_charset_len + (enc_scheme == PHP_ICONV_ENC_SCHEME_BASE64 ? 4 : 3); + size_t encoded_word_min_len = sizeof("=\?\?X\?\?=")-1 + out_charset_len + (enc_scheme == PHP_ICONV_ENC_SCHEME_BASE64 ? 4 : 3); if (char_cnt < encoded_word_min_len + lfchars_len + 1) { /* lfchars must be encoded in ASCII here*/ -- 2.40.0