mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
a375d54785
Cf. PR #6787. Closes GH-6994.
25 lines
486 B
PHP
25 lines
486 B
PHP
--TEST--
|
|
Bug #72697: select_colors write out-of-bounds
|
|
--EXTENSIONS--
|
|
gd
|
|
--SKIPIF--
|
|
<?php
|
|
if (PHP_INT_MAX !== 9223372036854775807) die("skip for 64-bit long systems only");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require __DIR__ . '/func.inc';
|
|
|
|
$img=imagecreatetruecolor(10, 10);
|
|
|
|
trycatch_dump(
|
|
fn() => imagetruecolortopalette($img, false, PHP_INT_MAX / 8)
|
|
);
|
|
|
|
?>
|
|
DONE
|
|
--EXPECT--
|
|
!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be greater than 0 and less than 2147483647
|
|
DONE
|