Commit 59028ba0 authored by zhouzhongyuan's avatar zhouzhongyuan Committed by Nick Wellnhofer

Fix possible null dereference in xmlXPathIdFunction

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

Closes #77.
parent b17e3d1c
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment