-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #77269: Potential unsigned underflow in gdImageScale
Belatedly, we're porting the respective upstream patch[1]. [1] <libgd/libgd@60bfb40>
- Loading branch information
Showing
2 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Bug #77269 (Potential unsigned underflow in gdImageScale) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('gd')) die('skip gd extension not available'); | ||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); | ||
?> | ||
--INI-- | ||
memory_limit=2G | ||
--FILE-- | ||
<?php | ||
$im = imagecreate(2**28, 1); | ||
if(is_resource($im)) { | ||
imagescale($im, 1, 1, IMG_TRIANGLE); | ||
} | ||
?> | ||
===DONE=== | ||
--EXPECTF-- | ||
Warning: imagecreate():%S product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully | ||
in %s on line %d | ||
===DONE=== |