GNOME Bugzilla – Bug 719550
rest-xml-parser: Ignore text content at the top-level of a document
Last modified: 2015-04-14 18:04:22 UTC
Found by scan-build.
Created attachment 263117 [details] [review] rest-xml-parser: Ignore text content at the top-level of a document This prevents a crash due to cur_node being NULL. Found by scan-build.
Review of attachment 263117 [details] [review]: This is not far from being something that could be a g_assert() as after asking DV, we can't get a _TEXT node before getting an _ELEMENT node. ::: rest/rest-xml-parser.c @@ +201,3 @@ + cur_node->content); + } else { + REST_DEBUG (XML_PARSER, "Text content ignored at top level."); Without going as far as having a g_assert(), let's make this a g_warning or g_critical as this theoritically can't happen regardless of what we are parsing.
Pushed with a change from REST_DEBUG to g_warning(). The following fix has been pushed: 11b2b07 rest-xml-parser: Ignore text content at the top-level of a document
Created attachment 301567 [details] [review] rest-xml-parser: Ignore text content at the top-level of a document This prevents a crash due to cur_node being NULL. Found by scan-build.