mirror of
https://github.com/php/php-src.git
synced 2026-04-15 12:01:07 +02:00
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fix null pointer deref in qprint-encode filter (bug #77231)
This commit is contained in:
@@ -922,7 +922,7 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins
|
||||
line_ccnt--;
|
||||
CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt);
|
||||
} else {
|
||||
if (line_ccnt < 4) {
|
||||
if (line_ccnt < 4 && inst->lbchars != NULL) {
|
||||
if (ocnt < inst->lbchars_len + 1) {
|
||||
err = PHP_CONV_ERR_TOO_BIG;
|
||||
break;
|
||||
|
||||
11
ext/standard/tests/filters/bug77231.phpt
Normal file
11
ext/standard/tests/filters/bug77231.phpt
Normal file
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #77231 (Segfault when using convert.quoted-printable-encode filter)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(file(urldecode('php://filter/convert.quoted-printable-encode/resource=data://,%bfAAAAAAAAFAAAAAAAAAAAAAA%ff%ff%ff%ff%ff%ff%ff%ffAAAAAAAAAAAAAAAAAAAAAAAA')));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(74) "=BFAAAAAAAAFAAAAAAAAAAAAAA=FF=FF=FF=FF=FF=FF=FF=FFAAAAAAAAAAAAAAAAAAAAAAAA"
|
||||
}
|
||||
Reference in New Issue
Block a user