Skip to content

Commit 4c6e170

Browse files
committed
Revert "Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter)"
This reverts commit d8ad2f4.
1 parent d8ad2f4 commit 4c6e170

File tree

4 files changed

+13
-37
lines changed

4 files changed

+13
-37
lines changed

NEWS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ PHP NEWS
4848
. Fixed bug #79000 (Non-blocking socket stream reports EAGAIN as error).
4949
(Nikita)
5050

51-
- Libxml:
52-
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
53-
5451
18 Dec 2019, PHP 7.4.1
5552

5653
- Core:

ext/libxml/libxml.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
355355
context = php_stream_context_from_zval(Z_ISUNDEF(LIBXML(stream_context))? NULL : &LIBXML(stream_context), 0);
356356

357357
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
358-
/* Prevent from closing this by fclose() */
359-
((php_stream*)ret_val)->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
360358
if (isescaped) {
361359
xmlFree(resolved_path);
362360
}

ext/xmlwriter/tests/bug79029.phpt

Lines changed: 0 additions & 32 deletions
This file was deleted.

ext/xmlwriter/tests/bug79029_1.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
#79029 (Use After Free's in XMLReader / XMLWriter)
3+
--SKIPIF--
4+
<?php if (!extension_loaded("xmlwriter")) print "skip"; ?>
5+
--FILE--
6+
<?php
7+
$x = array( new XMLWriter() );
8+
$x[0]->openUri("a");
9+
$x[0]->startComment();
10+
?>
11+
okey
12+
--EXPECT--
13+
okey

0 commit comments

Comments
 (0)