bug73549.phpt 392 B

123456789101112131415161718
  1. --TEST--
  2. Bug #73549 (Use after free when stream is passed to imagepng)
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $stream = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png', 'w');
  8. $im = imagecreatetruecolor(8, 8);
  9. var_dump(imagepng($im, $stream));
  10. var_dump($stream);
  11. ?>
  12. --EXPECTF--
  13. bool(true)
  14. resource(%d) of type (stream)
  15. --CLEAN--
  16. <?php
  17. unlink(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png');
  18. ?>