mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
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:
commit
05de40a651
2 changed files with 14 additions and 0 deletions
|
@ -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 '@':
|
||||||
|
|
10
ext/standard/tests/strings/bug75075.phpt
Normal file
10
ext/standard/tests/strings/bug75075.phpt
Normal 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) {
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue