[libxml2] Fix NULL pointer deref in xmlFAParseCharClassEsc



commit 8a0c66986e68c1c23fc3bb421b73465937c803b2
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Jul 4 17:13:06 2017 +0200

    Fix NULL pointer deref in xmlFAParseCharClassEsc
    
    Found with libFuzzer.

 xmlregexp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/xmlregexp.c b/xmlregexp.c
index 7dc6eea..019399f 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -4881,7 +4881,8 @@ xmlFAParseCharClassEsc(xmlRegParserCtxtPtr ctxt) {
        }
        NEXT;
        xmlFAParseCharProp(ctxt);
-       ctxt->atom->neg = 1;
+        if (ctxt->atom != NULL)
+           ctxt->atom->neg = 1;
        if (CUR != '}') {
            ERROR("Expecting '}'");
            return;


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