[libxml2] Use xmlStrlen in xmlNewStringInputStream



commit c21e9cd5d955e4d8afa514e1f7736ce6a9bb8f2e
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sat Aug 20 17:02:02 2022 +0200

    Use xmlStrlen in xmlNewStringInputStream
    
    xmlStrlen handles buffers larger than INT_MAX more gracefully.

 parserInternals.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/parserInternals.c b/parserInternals.c
index 7dc06c88..c3a14ac0 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -1356,7 +1356,7 @@ xmlNewStringInputStream(xmlParserCtxtPtr ctxt, const xmlChar *buffer) {
        xmlGenericError(xmlGenericErrorContext,
                "new fixed input: %.30s\n", buffer);
     buf = xmlParserInputBufferCreateMem((const char *) buffer,
-                                        strlen((const char *) buffer),
+                                        xmlStrlen(buffer),
                                         XML_CHAR_ENCODING_NONE);
     if (buf == NULL) {
        xmlErrMemory(ctxt, NULL);


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