1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix potential NULL deref

Backported from GH-18697.
This commit is contained in:
Niels Dossche
2025-05-29 16:57:31 +02:00
parent 40422e9c55
commit dd856d5ad9

View File

@@ -1872,7 +1872,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
} else {
xmlNsPtr nsPtr = attr_find_ns(attr);
if (strncmp((char*)nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) {
if (nsPtr && strncmp((char*)nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) {
smart_str key2 = {0};
sdlExtraAttributePtr ext;
xmlNsPtr nsptr;