com php-src: Escape trigraph sequence: ext/iconv/iconv.c
| From: | Nikita Popov | Date: | Tue, 04 Sep 2018 03:07:43 +0000 |
| Subject: | com php-src: Escape trigraph sequence: ext/iconv/iconv.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-102978@lists.php.net to get a copy of this message | ||
Commit: 153e292e108f2fcd411ae75a00d3814987ccf17d
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 4 Sep 2018 05:07:43 +0200
Parents: 6122f67492401e04bab37bd864e3d5f53e6f4a75
Branches: PHP-7.3 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=153e292e108f2fcd411ae75a00d3814987ccf17d
Log:
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.
Changed paths:
M ext/iconv/iconv.c
Diff:
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 38a775c..d1b28c1 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*/