Skip to content

Commit b63d41e

Browse files
committed
add tests for bug #72512
1 parent 7b2c226 commit b63d41e

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

ext/gd/tests/bug72512_0.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 0
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('gd')) die("skip gd extension not available\n");
6+
?>
7+
--FILE--
8+
<?php
9+
10+
$img = imagecreatetruecolor(13, 1007);
11+
12+
imagecolortransparent($img, -10066304);
13+
imagetruecolortopalette($img, TRUE, 3);
14+
imagescale($img, 1, 65535);
15+
?>
16+
==DONE==
17+
--EXPECT--
18+
==DONE==

ext/gd/tests/bug72512_1.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 1
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('gd')) die("skip gd extension not available\n");
6+
?>
7+
--FILE--
8+
<?php
9+
10+
$img = imagecreatetruecolor(100, 100);
11+
imagecolortransparent($img, -1000000);
12+
imagetruecolortopalette($img, TRUE, 3);
13+
imagecolortransparent($img, 9);
14+
15+
?>
16+
==DONE==
17+
--EXPECT--
18+
==DONE==

0 commit comments

Comments
 (0)