mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4'
This commit is contained in:
@@ -819,6 +819,11 @@ PHP_FUNCTION(imagefilledellipse)
|
||||
Z_PARAM_LONG(color)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if (w < 0 || ZEND_LONG_INT_OVFL(w)) {
|
||||
zend_argument_value_error(4, "must be between 0 and %d", INT_MAX);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
im = php_gd_libgdimageptr_from_zval_p(IM);
|
||||
|
||||
gdImageFilledEllipse(im, cx, cy, w, h, color);
|
||||
|
||||
27
ext/gd/tests/gh19578.phpt
Normal file
27
ext/gd/tests/gh19578.phpt
Normal file
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
GH-19578: imagefilledellipse underflow on width argument
|
||||
--EXTENSIONS--
|
||||
gd
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 8) die('skip this test is for 64bit platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$src = imagecreatetruecolor(255, 255);
|
||||
|
||||
try {
|
||||
imagefilledellipse($src, 0, 0, PHP_INT_MAX, 254, 0);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
imagefilledellipse($src, 0, 0, -16, 254, 0);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
imagefilledellipse(): Argument #4 ($width) must be between 0 and %d
|
||||
imagefilledellipse(): Argument #4 ($width) must be between 0 and %d
|
||||
20
ext/gd/tests/gh19578_32bits.phpt
Normal file
20
ext/gd/tests/gh19578_32bits.phpt
Normal file
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
GH-19578: imagefilledellipse underflow on width argument
|
||||
--EXTENSIONS--
|
||||
gd
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$src = imagecreatetruecolor(255, 255);
|
||||
|
||||
try {
|
||||
imagefilledellipse($src, 0, 0, -16, 254, 0);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
imagefilledellipse(): Argument #4 ($width) must be between 0 and %d
|
||||
Reference in New Issue
Block a user