summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug73549.phpt
blob: e0cc6cf42e5723d92a42d8996cb018b9078db57d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Bug #73549 (Use after free when stream is passed to imagepng)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$stream = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png', 'w');
$im = imagecreatetruecolor(8, 8);
var_dump(imagepng($im, $stream));
var_dump($stream);
?>
===DONE===
--EXPECTF--
bool(true)
resource(%d) of type (stream)
===DONE===
--CLEAN--
<?php
unlink(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png');
?>