Package: libxml2 / 2.9.1+dfsg1-5+deb8u6

0012-Fix-a-possible-NULL-dereference.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Gaurav <g.gupta@40samsung.com>
Date: Sat, 3 Aug 2013 22:16:02 +0800
Subject: Fix a possible NULL dereference

https://bugzilla.gnome.org/show_bug.cgi?id=705400
In case of allocation error the pointer was dereferenced before the
test for a failure
---
 SAX2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SAX2.c b/SAX2.c
index 4adf202..33d167e 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -994,12 +994,12 @@ xmlSAX2StartDocument(void *ctx)
 #ifdef LIBXML_HTML_ENABLED
 	if (ctxt->myDoc == NULL)
 	    ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
-	ctxt->myDoc->properties = XML_DOC_HTML;
-	ctxt->myDoc->parseFlags = ctxt->options;
 	if (ctxt->myDoc == NULL) {
 	    xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
 	    return;
 	}
+	ctxt->myDoc->properties = XML_DOC_HTML;
+	ctxt->myDoc->parseFlags = ctxt->options;
 #else
         xmlGenericError(xmlGenericErrorContext,
 		"libxml2 built without HTML support\n");