summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2014-07-14 20:29:34 +0800
committerDaniel Veillard <veillard@redhat.com>2014-07-14 20:29:34 +0800
commita6ea72ad192f4209b5073e39358ce15f3f1dca4b (patch)
treed58fbecacb8bcf0e4f82d20440d7433613506927
parent23243301a68ac56cc5dbfdcf2271589bd46fa71c (diff)
downloadlibxml2-a6ea72ad192f4209b5073e39358ce15f3f1dca4b.tar.gz
Fix processing in SAX2 in case of an allocation failure
Related to https://bugzilla.gnome.org/show_bug.cgi?id=731360
-rw-r--r--SAX2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/SAX2.c b/SAX2.c
index e616efe1..ffef3e14 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -2580,6 +2580,7 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
}
if (lastChild->content == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: xmlStrdup returned NULL");
+ return;
}
if (((size_t)ctxt->nodelen + (size_t)len > XML_MAX_TEXT_LENGTH) &&
((ctxt->options & XML_PARSE_HUGE) == 0)) {