mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-08 01:37:30 +00:00
Fix bug #72730 - imagegammacorrect allows arbitrary write access
This commit is contained in:
1 parent
a3598dd7c9
commit
1bd103df00
2 files changed
+20
No files matched your search
@@ -3082,6 +3082,11 @@ PHP_FUNCTION(imagegammacorrect)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( input <= 0.0 || output <= 0.0 ) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positive");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
|
||||
|
||||
if (gdImageTrueColor(im)) {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #72730: imagegammacorrect allows arbitrary write access
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists("imagecreatetruecolor")) die("skip");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$img = imagecreatetruecolor(1, 1);
|
||||
imagegammacorrect($img, -1, 1337);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: imagegammacorrect(): Gamma values should be positive in %sbug72730.php on line %d
|
||||
DONE
|
||||
Reference in new issue
Block a user