1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-19 14:50:07 +03:00

Fix possible null dereference in xmlXPathIdFunction

If a certain memory allocation fails, xmlXPathIdFunction would
dereference a null pointer.

Closes #77.
This commit is contained in:
zhouzhongyuan 2019-08-07 14:38:07 +08:00 committed by Nick Wellnhofer
parent b17e3d1c2b
commit 59028ba08c

1
xpath.c Normal file → Executable file
View File

@ -8626,6 +8626,7 @@ xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs) {
return;
}
obj = xmlXPathCacheConvertString(ctxt->context, obj);
if (obj == NULL) return;
ret = xmlXPathGetElementsByIds(ctxt->context->doc, obj->stringval);
valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt->context, ret));
xmlXPathReleaseObject(ctxt->context, obj);