bug79029.phpt 697 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. #79029 (Use After Free's in XMLReader / XMLWriter)
  3. --EXTENSIONS--
  4. xmlwriter
  5. xmlreader
  6. --FILE--
  7. <?php
  8. $x = array( new XMLWriter() );
  9. $x[0]->openUri("bug79029_1.txt");
  10. $x[0]->startComment();
  11. $y = new XMLWriter();
  12. $y->openUri("bug79029_2.txt");
  13. fclose(@end(get_resources()));
  14. file_put_contents("bug79029_3.txt", "a");
  15. $z = new XMLReader();
  16. $z->open("bug79029_3.txt");
  17. fclose(@end(get_resources()));
  18. ?>
  19. okey
  20. --CLEAN--
  21. <?php
  22. @unlink("bug79029_1.txt");
  23. @unlink("bug79029_2.txt");
  24. @unlink("bug79029_3.txt");
  25. ?>
  26. --EXPECTF--
  27. Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
  28. Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
  29. okey