php-src/ext/standard/tests/strings/bug78833.phpt
Nikita Popov de77344de2 Promote pack/unpack format errors
Errors related to invalid format strings (unlike data mismatch
errors) should throw ValueError.

Closes GH-6185.
2020-09-22 15:12:05 +02:00

13 lines
250 B
PHP

--TEST--
Bug #78833 (Integer overflow in pack causes out-of-bound access)
--FILE--
<?php
try {
var_dump(pack("E2E2147483647H*", 0x0, 0x0, 0x0));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Type E: too few arguments