Skip to content

Commit de31324

Browse files
mjsmalyshev
authored andcommitted
Fix bug #64938: libxml_disable_entity_loader setting is shared between threads
The availability of entity loading is stored in a module global which previously was only initialized in the GINIT constructor. This had the effect that disabling the entity loader in one request caused subsequent requests hitting the same Apache child process to also have the loader disabled. With this change the loader is explicitely enabled in the request init phase.
1 parent e5e251b commit de31324

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ PHP NEWS
2323
. Fixed bug #68571 (core dump when webserver close the socket).
2424
(redfoxli069 at gmail dot com, Laruence)
2525

26+
- Libxml:
27+
. Fixed bug #64938 (libxml_disable_entity_loader setting is shared
28+
between threads). (Martin Jansen)
29+
2630
- OpenSSL:
2731
. Fixed bug #55618 (use case-insensitive cert name matching).
2832
(Daniel Lowrey)

ext/libxml/libxml.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,12 @@ static PHP_RINIT_FUNCTION(libxml)
857857
xmlSetGenericErrorFunc(NULL, php_libxml_error_handler);
858858
xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename);
859859
xmlOutputBufferCreateFilenameDefault(php_libxml_output_buffer_create_filename);
860+
861+
/* Enable the entity loader by default. This ensure that
862+
* other threads/requests that might have disable the loader
863+
* do not affect the current request.
864+
*/
865+
LIBXML(entity_loader_disabled) = 0;
860866
}
861867
return SUCCESS;
862868
}

0 commit comments

Comments
 (0)