mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
[LIBXML2] Update to version 2.10.3. CORE-17766
This commit is contained in:
parent
19da1718e5
commit
c0027d117c
7 changed files with 172 additions and 169 deletions
24
sdk/lib/3rdparty/libxml2/SAX2.c
vendored
24
sdk/lib/3rdparty/libxml2/SAX2.c
vendored
|
@ -28,11 +28,6 @@
|
|||
#include <libxml/HTMLtree.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
/* Define SIZE_T_MAX unless defined through <limits.h>. */
|
||||
#ifndef SIZE_T_MAX
|
||||
# define SIZE_T_MAX ((size_t)-1)
|
||||
#endif /* !SIZE_T_MAX */
|
||||
|
||||
/* #define DEBUG_SAX2 */
|
||||
/* #define DEBUG_SAX2_TREE */
|
||||
|
||||
|
@ -2596,22 +2591,23 @@ xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
|
|||
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: xmlStrdup returned NULL");
|
||||
return;
|
||||
}
|
||||
if (((size_t)ctxt->nodelen + (size_t)len > XML_MAX_TEXT_LENGTH) &&
|
||||
if (ctxt->nodelen > INT_MAX - len) {
|
||||
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters overflow prevented");
|
||||
return;
|
||||
}
|
||||
if ((ctxt->nodelen + len > XML_MAX_TEXT_LENGTH) &&
|
||||
((ctxt->options & XML_PARSE_HUGE) == 0)) {
|
||||
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: huge text node");
|
||||
return;
|
||||
}
|
||||
if ((size_t)ctxt->nodelen > SIZE_T_MAX - (size_t)len ||
|
||||
(size_t)ctxt->nodemem + (size_t)len > SIZE_T_MAX / 2) {
|
||||
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters overflow prevented");
|
||||
return;
|
||||
}
|
||||
if (ctxt->nodelen + len >= ctxt->nodemem) {
|
||||
xmlChar *newbuf;
|
||||
size_t size;
|
||||
int size;
|
||||
|
||||
size = ctxt->nodemem + len;
|
||||
size *= 2;
|
||||
size = ctxt->nodemem > INT_MAX - len ?
|
||||
INT_MAX :
|
||||
ctxt->nodemem + len;
|
||||
size = size > INT_MAX / 2 ? INT_MAX : size * 2;
|
||||
newbuf = (xmlChar *) xmlRealloc(lastChild->content,size);
|
||||
if (newbuf == NULL) {
|
||||
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue