Skip to content

Commit

Permalink
add tests for bug #72512
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Jul 6, 2016
1 parent 7b2c226 commit b63d41e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ext/gd/tests/bug72512_0.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 0
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php

$img = imagecreatetruecolor(13, 1007);

imagecolortransparent($img, -10066304);
imagetruecolortopalette($img, TRUE, 3);
imagescale($img, 1, 65535);
?>
==DONE==
--EXPECT--
==DONE==
18 changes: 18 additions & 0 deletions ext/gd/tests/bug72512_1.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 1
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php

$img = imagecreatetruecolor(100, 100);
imagecolortransparent($img, -1000000);
imagetruecolortopalette($img, TRUE, 3);
imagecolortransparent($img, 9);

?>
==DONE==
--EXPECT--
==DONE==

0 comments on commit b63d41e

Please sign in to comment.