mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
Use xmlStrlen in *CtxtReadDoc
xmlStrlen handles buffers larger than INT_MAX more gracefully.
This commit is contained in:
@ -7116,13 +7116,10 @@ htmlDocPtr
|
|||||||
htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur,
|
htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur,
|
||||||
const char *URL, const char *encoding, int options)
|
const char *URL, const char *encoding, int options)
|
||||||
{
|
{
|
||||||
const char *buf;
|
|
||||||
|
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
buf = (const char *) cur;
|
return (htmlCtxtReadMemory(ctxt, (const char *) cur, xmlStrlen(cur), URL,
|
||||||
return (htmlCtxtReadMemory(ctxt, buf, strlen(buf), URL, encoding,
|
encoding, options));
|
||||||
options));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
6
parser.c
6
parser.c
@ -15359,12 +15359,10 @@ xmlDocPtr
|
|||||||
xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur,
|
xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur,
|
||||||
const char *URL, const char *encoding, int options)
|
const char *URL, const char *encoding, int options)
|
||||||
{
|
{
|
||||||
const char *buf;
|
|
||||||
|
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
buf = (const char *) cur;
|
return (xmlCtxtReadMemory(ctxt, (const char *) cur, xmlStrlen(cur), URL,
|
||||||
return (xmlCtxtReadMemory(ctxt, buf, strlen(buf), URL, encoding, options));
|
encoding, options));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user