1
From: Daniel Veillard <veillard@redhat.com>
2
Date: Sat, 3 Aug 2013 22:25:13 +0800
3
Subject: Clear up a potential NULL dereference
5
https://bugzilla.gnome.org/show_bug.cgi?id=705399
7
if ctxt->node_seq.buffer is null then ctxt->node_seq.maximum ought
8
to be zero but it's better to clarify the check in the code directly.
10
parserInternals.c | 3 ++-
11
1 file changed, 2 insertions(+), 1 deletion(-)
13
diff --git a/parserInternals.c b/parserInternals.c
14
index f8a7041..98a5836 100644
15
--- a/parserInternals.c
16
+++ b/parserInternals.c
17
@@ -1990,7 +1990,8 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt,
19
/* Otherwise, we need to add new node to buffer */
21
- if (ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) {
22
+ if ((ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) ||
23
+ (ctxt->node_seq.buffer == NULL)) {
24
xmlParserNodeInfo *tmp_buffer;
25
unsigned int byte_size;