1
0
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:
Stanislav Malyshev
2018-12-03 10:19:57 -08:00
2 changed files with 12 additions and 1 deletions

View File

@@ -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;

View 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"
}