mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.2' into PHP-8.3
This commit is contained in:
commit
fde5e507f6
3 changed files with 30 additions and 1 deletions
4
NEWS
4
NEWS
|
@ -36,8 +36,10 @@ PHP NEWS
|
||||||
. Fixed bug GH-15168 (stack overflow in json_encode()). (nielsdos)
|
. Fixed bug GH-15168 (stack overflow in json_encode()). (nielsdos)
|
||||||
|
|
||||||
- GD:
|
- GD:
|
||||||
. Fixed bug 16232 (bitshift overflow on wbmp file content reading /
|
. Fixed bug GH-16232 (bitshift overflow on wbmp file content reading /
|
||||||
fix backport from upstream). (David Carlier)
|
fix backport from upstream). (David Carlier)
|
||||||
|
. Fixed bug GH-12264 (overflow/underflow on imagerotate degrees value)
|
||||||
|
(David Carlier)
|
||||||
|
|
||||||
- LDAP:
|
- LDAP:
|
||||||
. Fixed bug GH-16032 (Various NULL pointer dereferencements in
|
. Fixed bug GH-16032 (Various NULL pointer dereferencements in
|
||||||
|
|
|
@ -1194,6 +1194,11 @@ PHP_FUNCTION(imagerotate)
|
||||||
RETURN_THROWS();
|
RETURN_THROWS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (degrees < (double)(INT_MIN / 100) || degrees > (double)(INT_MAX / 100)) {
|
||||||
|
zend_argument_value_error(2, "must be between %d and %d", (INT_MIN / 100), (INT_MAX / 100));
|
||||||
|
RETURN_THROWS();
|
||||||
|
}
|
||||||
|
|
||||||
im_src = php_gd_libgdimageptr_from_zval_p(SIM);
|
im_src = php_gd_libgdimageptr_from_zval_p(SIM);
|
||||||
im_dst = gdImageRotateInterpolated(im_src, (const float)degrees, color);
|
im_dst = gdImageRotateInterpolated(im_src, (const float)degrees, color);
|
||||||
|
|
||||||
|
|
22
ext/gd/tests/gh16260.phpt
Normal file
22
ext/gd/tests/gh16260.phpt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16260 (Overflow/underflow on imagerotate degrees argument)
|
||||||
|
--EXTENSIONS--
|
||||||
|
gd
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$im = imagecreatetruecolor(10,10);
|
||||||
|
|
||||||
|
try {
|
||||||
|
imagerotate($im, PHP_INT_MIN, 0);
|
||||||
|
} catch (\ValueError $e) {
|
||||||
|
echo $e->getMessage() . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
imagerotate($im, PHP_INT_MAX, 0);
|
||||||
|
} catch (\ValueError $e) {
|
||||||
|
echo $e->getMessage();
|
||||||
|
}
|
||||||
|
--EXPECTF--
|
||||||
|
imagerotate(): Argument #2 ($angle) must be between %s and %s
|
||||||
|
imagerotate(): Argument #2 ($angle) must be between %s and %s
|
Loading…
Add table
Add a link
Reference in a new issue