Skip to content

Commit f14e5fc

Browse files
SpencerMalonendossche
authored andcommitted
Fix not thread safe xmlSchemaParse calls in ZTS builds
By calling xmlSchemaInitTypes during MINIT. See: https://gitlab.gnome.org/GNOME/libxml2/-/issues/930 Closes GH-20150.
1 parent 88f8c5c commit f14e5fc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ PHP NEWS
1919
. Fixed bug GH-20070 (Return type violation in imagefilter when an invalid
2020
filter is provided). (Girgias)
2121

22+
- LibXML:
23+
. Fix not thread safe xmlSchemaParse calls. (SpencerMalone)
24+
2225
- Opcache:
2326
. Fixed bug GH-20081 (access to uninitialized vars in preload_load()).
2427
(Arnaud)

ext/libxml/libxml.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#ifdef LIBXML_SCHEMAS_ENABLED
4040
#include <libxml/relaxng.h>
4141
#include <libxml/xmlschemas.h>
42+
#include <libxml/xmlschemastypes.h>
4243
#endif
4344

4445
#include "php_libxml.h"
@@ -933,7 +934,11 @@ PHP_LIBXML_API void php_libxml_initialize(void)
933934
if (!_php_libxml_initialized) {
934935
/* we should be the only one's to ever init!! */
935936
ZEND_IGNORE_LEAKS_BEGIN();
937+
936938
xmlInitParser();
939+
#ifdef LIBXML_SCHEMAS_ENABLED
940+
xmlSchemaInitTypes();
941+
#endif
937942
ZEND_IGNORE_LEAKS_END();
938943

939944
_php_libxml_default_entity_loader = xmlGetExternalEntityLoader();

0 commit comments

Comments
 (0)