Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter).
This commit is contained in:
Xinchen Hui 2019-12-25 16:29:30 +08:00
commit ce4d80a85a
3 changed files with 36 additions and 13 deletions

View file

@ -327,6 +327,10 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
context = php_stream_context_from_zval(Z_ISUNDEF(LIBXML(stream_context))? NULL : &LIBXML(stream_context), 0);
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
if (ret_val) {
/* Prevent from closing this by fclose() */
((php_stream*)ret_val)->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
}
if (isescaped) {
xmlFree(resolved_path);
}