[libxml2] Fix potential double-free in xmlXPtrStringRangeFunction



commit 10291f838f5dadf6879043710cee7785b954a8af
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sat Mar 5 18:25:16 2022 +0100

    Fix potential double-free in xmlXPtrStringRangeFunction
    
    Fix double-free in an unlikely error condition. Thanks to Wentao Liang
    for the report.
    
    Fixes #341.

 xpointer.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/xpointer.c b/xpointer.c
index 2449157c..02041d3b 100644
--- a/xpointer.c
+++ b/xpointer.c
@@ -2753,6 +2753,7 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
         */
        tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
        xmlXPathFreeObject(set);
+        set = NULL;
        if (tmp == NULL) {
             xmlXPathErr(ctxt, XPATH_MEMORY_ERROR);
             goto error;


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