[libxml2] Fix pointer dereferenced before null check



commit c570b37972b364d03605a0c67b8497bc4b3227af
Author: Gaurav <g gupta samsung com>
Date:   Mon Sep 30 10:43:47 2013 +0800

    Fix pointer dereferenced before null check
    
    for https://bugzilla.gnome.org/show_bug.cgi?id=708364
    
    xmlValidateElementContent is a private function but should still
    check the ctxt argument before dereferencing

 valid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/valid.c b/valid.c
index 6e53a76..e0832e7 100644
--- a/valid.c
+++ b/valid.c
@@ -5236,7 +5236,7 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child,
     xmlElementContentPtr cont;
     const xmlChar *name;
 
-    if ((elemDecl == NULL) || (parent == NULL))
+    if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL))
        return(-1);
     cont = elemDecl->content;
     name = elemDecl->name;


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