Skip to content
Browse files

Merge pull request #448 from gao-yan/xml-tracking-changes-segfault

Fix: xml: Fix segfault in TRACKING_CHANGES()
  • Loading branch information...
2 parents 0debc91 + 1fc1c95 commit 28fba1c582b553142b9e9dd736bd0d141b168773 @beekhof committed Feb 28, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/common/xml.c
View
2 lib/common/xml.c
@@ -139,7 +139,7 @@ static xmlNode *find_xml_comment(xmlNode * root, xmlNode * search_comment);
static int add_xml_comment(xmlNode * parent, xmlNode * target, xmlNode * update);
#define CHUNK_SIZE 1024
-#define TRACKING_CHANGES(xml) xml->doc?is_set(((xml_private_t *)xml->doc->_private)->flags, xpf_tracking):FALSE
+#define TRACKING_CHANGES(xml) xml && xml->doc && xml->doc->_private? is_set(((xml_private_t *)xml->doc->_private)->flags, xpf_tracking):FALSE
#define buffer_print(buffer, max, offset, fmt, args...) do { \
int rc = (max); \

0 comments on commit 28fba1c

Please sign in to comment.
Something went wrong with that request. Please try again.