1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

Use xmlStrlen in xmlNewStringInputStream

xmlStrlen handles buffers larger than INT_MAX more gracefully.
This commit is contained in:
Nick Wellnhofer 2022-08-20 17:02:02 +02:00
parent 5b2d07a726
commit c21e9cd5d9

View File

@ -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);