[libxml2] Fix possible null dereference in xmlXPathIdFunction



commit 59028ba08c7e035a9976ed492598fa8a50139801
Author: zhouzhongyuan <zhouzhongyuan huawei com>
Date:   Wed Aug 7 14:38:07 2019 +0800

    Fix possible null dereference in xmlXPathIdFunction
    
    If a certain memory allocation fails, xmlXPathIdFunction would
    dereference a null pointer.
    
    Closes #77.

 xpath.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/xpath.c b/xpath.c
old mode 100644
new mode 100755
index 65a9f09e..9cbd6650
--- a/xpath.c
+++ b/xpath.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]