summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug72709.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/tests/bug72709.phpt')
-rw-r--r--ext/gd/tests/bug72709.phpt18
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/gd/tests/bug72709.phpt b/ext/gd/tests/bug72709.phpt
new file mode 100644
index 0000000000..1c5b1f4ae0
--- /dev/null
+++ b/ext/gd/tests/bug72709.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #72709 (imagesetstyle() causes OOB read for empty $styles)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip ext/gd not available');
+?>
+--FILE--
+<?php
+$im = imagecreatetruecolor(1, 1);
+var_dump(imagesetstyle($im, array()));
+imagesetpixel($im, 0, 0, IMG_COLOR_STYLED);
+imagedestroy($im);
+?>
+====DONE====
+--EXPECTF--
+Warning: imagesetstyle(): styles array must not be empty in %s%ebug72709.php on line %d
+bool(false)
+====DONE====