Re: com php-src: Escape trigraph sequence: ext/iconv/iconv.c
| From: | Christoph M. Becker | Date: | Tue, 04 Sep 2018 09:17:03 +0000 |
| Subject: | Re: com php-src: Escape trigraph sequence: ext/iconv/iconv.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-102995@lists.php.net to get a copy of this message | ||
On 04.09.2018 at 05:07, Nikita Popov wrote:
> 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
Thanks for catching this!
Cheers,
Christoph
> ??= 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*/
>