Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Update NEWS
  Fixed bug #75075 (unpack with X* causes infinity loop)
This commit is contained in:
Xinchen Hui 2017-08-15 12:35:10 +08:00
commit 05de40a651
2 changed files with 14 additions and 0 deletions

View file

@ -788,6 +788,10 @@ PHP_FUNCTION(unpack)
/* Never use any input */ /* Never use any input */
case 'X': case 'X':
size = -1; size = -1;
if (arg < 0) {
php_error_docref(NULL, E_WARNING, "Type %c: '*' ignored", type);
arg = 1;
}
break; break;
case '@': case '@':

View file

@ -0,0 +1,10 @@
--TEST--
Bug #75075 (unpack with X* causes infinity loop)
--FILE--
<?php
var_dump(unpack("X*", ""));
?>
--EXPECTF--
Warning: unpack(): Type X: '*' ignored in %sbug75075.php on line %d
array(0) {
}