summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-01-04 14:42:52 +0000
committerRichard Hughes <richard@hughsie.com>2017-01-04 14:42:52 +0000
commit4519b335fc02d231e44d10e95d02e9beb38dbec5 (patch)
treed8972a54376519e9c0b22b3dd009021cc131c1c4
parent49749de0bd597e5e9fe5e4b92875d6730a7b6968 (diff)
downloadappstream-glib-4519b335fc02d231e44d10e95d02e9beb38dbec5.tar.gz
trivial: Fix a critical warning when parsing <p><ul><li/></ul></p>
-rw-r--r--libappstream-glib/as-node.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c
index f02d155..33899d8 100644
--- a/libappstream-glib/as-node.c
+++ b/libappstream-glib/as-node.c
@@ -260,6 +260,8 @@ as_node_cdata_to_raw (AsNodeData *data)
return;
if (!data->is_cdata_escaped)
return;
+ if (data->cdata == NULL)
+ return;
if (data->is_cdata_const)
as_node_cdata_to_heap (data);
as_node_string_replace_inplace (data->cdata, "&amp;", '&');
@@ -275,6 +277,8 @@ as_node_cdata_to_escaped (AsNodeData *data)
return;
if (data->is_cdata_escaped)
return;
+ if (data->cdata == NULL)
+ return;
if (g_strstr_len (data->cdata, -1, "&") != NULL ||
g_strstr_len (data->cdata, -1, "<") != NULL ||
g_strstr_len (data->cdata, -1, ">") != NULL) {