mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix #73957: signed integer conversion in imagescale()
This commit is contained in:
commit
d709922979
1
NEWS
1
NEWS
@ -24,6 +24,7 @@ PHP NEWS
|
||||
. Fixed ftp_pasv arginfo. (carusogabriel)
|
||||
|
||||
-GD:
|
||||
. Fixed bug #73957 (signed integer conversion in imagescale()). (cmb)
|
||||
. Fixed bug #76041 (null pointer access crashed php). (cmb)
|
||||
. Fixed imagesetinterpolation arginfo. (Gabriel Caruso)
|
||||
|
||||
|
@ -4842,7 +4842,7 @@ PHP_FUNCTION(imagescale)
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp_h <= 0 || tmp_w <= 0) {
|
||||
if (tmp_h <= 0 || tmp_h > INT_MAX || tmp_w <= 0 || tmp_w > INT_MAX) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
20
ext/gd/tests/bug73957.phpt
Normal file
20
ext/gd/tests/bug73957.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73957 (signed integer conversion in imagescale())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (PHP_INT_SIZE != 8) die('skip this test is for 64bit platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(8, 8);
|
||||
$im = imagescale($im, 0x100000001, 1);
|
||||
var_dump($im);
|
||||
if ($im) { // which is not supposed to happen
|
||||
var_dump(imagesx($im));
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user