bug72709.phpt 407 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #72709 (imagesetstyle() causes OOB read for empty $styles)
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $im = imagecreatetruecolor(1, 1);
  8. try {
  9. var_dump(imagesetstyle($im, array()));
  10. }
  11. catch (\Error $ex) {
  12. echo $ex->getMessage() . "\n";
  13. }
  14. imagesetpixel($im, 0, 0, IMG_COLOR_STYLED);
  15. imagedestroy($im);
  16. ?>
  17. ====DONE====
  18. --EXPECT--
  19. imagesetstyle(): Argument #2 ($style) cannot be empty
  20. ====DONE====