xref: /PHP-8.0/ext/gd/tests/bug72709.phpt (revision 14a26db3)
1--TEST--
2Bug #72709 (imagesetstyle() causes OOB read for empty $styles)
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip ext/gd not available');
6?>
7--FILE--
8<?php
9$im = imagecreatetruecolor(1, 1);
10
11try {
12    var_dump(imagesetstyle($im, array()));
13}
14catch (\Error $ex) {
15    echo $ex->getMessage() . "\n";
16}
17
18imagesetpixel($im, 0, 0, IMG_COLOR_STYLED);
19imagedestroy($im);
20?>
21====DONE====
22--EXPECT--
23imagesetstyle(): Argument #2 ($style) cannot be empty
24====DONE====
25