From 57a3480f956b5187485a55d36300d19efa04b07f Mon Sep 17 00:00:00 2001 From: "Fred L. Drake, Jr." Date: Thu, 9 Aug 2001 18:08:56 +0000 Subject: [PATCH] XML_Parse(): If XML_GetBuffer() returns NULL, do not attempt to move data aronud, just propogate the error. This closes SF bug #434665. --- expat/lib/xmlparse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 7c6a8017..df69b749 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -1134,8 +1134,13 @@ int XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) } #endif /* not defined XML_CONTEXT_BYTES */ else { - memcpy(XML_GetBuffer(parser, len), s, len); - return XML_ParseBuffer(parser, len, isFinal); + void *buff = XML_GetBuffer(parser, len); + if (buff == NULL) + return 0; + else { + memcpy(buff, s, len); + return XML_ParseBuffer(parser, len, isFinal); + } } } -- 2.40.0