[libxml2] Fix overflow check in xmlNodeDump



commit c9faa29259ac23b5fbf945f61056288e413dae81
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Thu Jan 2 14:12:39 2020 +0100

    Fix overflow check in xmlNodeDump
    
    Store return value of xmlBufNodeDump in a size_t before checking for
    integer overflow.
    
    Found by lgtm.com

 xmlsave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/xmlsave.c b/xmlsave.c
index 7158c26b..b06e24d9 100644
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -2187,7 +2187,7 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
             int format)
 {
     xmlBufPtr buffer;
-    int ret;
+    size_t ret;
 
     if ((buf == NULL) || (cur == NULL))
         return(-1);


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