]> granicus.if.org Git - php/commitdiff
add tests for bug #72512
authorAnatol Belski <ab@php.net>
Wed, 6 Jul 2016 08:40:52 +0000 (10:40 +0200)
committerAnatol Belski <ab@php.net>
Wed, 6 Jul 2016 08:40:52 +0000 (10:40 +0200)
ext/gd/tests/bug72512_0.phpt [new file with mode: 0644]
ext/gd/tests/bug72512_1.phpt [new file with mode: 0644]

diff --git a/ext/gd/tests/bug72512_0.phpt b/ext/gd/tests/bug72512_0.phpt
new file mode 100644 (file)
index 0000000..5f98662
--- /dev/null
@@ -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==
diff --git a/ext/gd/tests/bug72512_1.phpt b/ext/gd/tests/bug72512_1.phpt
new file mode 100644 (file)
index 0000000..bba01a7
--- /dev/null
@@ -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==