1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 05:21:02 +02:00
Files
archived-php-src/ext/xmlwriter/tests/bug79029.phpt
Nikita Popov 7485978339 Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

33 lines
697 B
PHP

--TEST--
#79029 (Use After Free's in XMLReader / XMLWriter)
--EXTENSIONS--
xmlwriter
xmlreader
--FILE--
<?php
$x = array( new XMLWriter() );
$x[0]->openUri("bug79029_1.txt");
$x[0]->startComment();
$y = new XMLWriter();
$y->openUri("bug79029_2.txt");
fclose(@end(get_resources()));
file_put_contents("bug79029_3.txt", "a");
$z = new XMLReader();
$z->open("bug79029_3.txt");
fclose(@end(get_resources()));
?>
okey
--CLEAN--
<?php
@unlink("bug79029_1.txt");
@unlink("bug79029_2.txt");
@unlink("bug79029_3.txt");
?>
--EXPECTF--
Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
okey