summaryrefslogtreecommitdiff
path: root/bindings/xml/expat_xmlparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/xml/expat_xmlparser.c')
-rw-r--r--bindings/xml/expat_xmlparser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bindings/xml/expat_xmlparser.c b/bindings/xml/expat_xmlparser.c
index 4bdd5c9..278073c 100644
--- a/bindings/xml/expat_xmlparser.c
+++ b/bindings/xml/expat_xmlparser.c
@@ -359,6 +359,11 @@ expat_xmlparser_comment_handler(void *_parser,
dom_string *data;
dom_exception err;
+ if (parser->current == NULL) {
+ /* not currently building a node so cannot have comment */
+ return;
+ }
+
/* Create DOM string data for comment */
err = dom_string_create((const uint8_t *)_comment,
strlen((const char *) _comment), &data);