[libxml2] Fix another memory leak in xmlSchemaValAtomicType



commit 50f18830e179f273c244d4969485c4154c81cc01
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sun Jun 21 15:21:45 2020 +0200

    Fix another memory leak in xmlSchemaValAtomicType
    
    Don't collapse language IDs twice.
    
    Found with libFuzzer and ASan.

 xmlschemastypes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 1a440524..35edfd6f 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -2636,7 +2636,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
                 goto return0;
             }
         case XML_SCHEMAS_LANGUAGE:
-           if (normOnTheFly) {
+           if ((norm == NULL) && (normOnTheFly)) {
                norm = xmlSchemaCollapseString(value);
                if (norm != NULL)
                    value = norm;


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