summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-11-08 21:22:53 +0100
committerGravatar Nikias Bassen2012-11-08 21:22:53 +0100
commit58151b6cd801435d79145907cf6ef779d21573d3 (patch)
treeb3e44d8d1afa3071c44561573c494a92ada0bd2d /src
parentc9382f08d1fec4951b9acea9345ddd64cd619d56 (diff)
downloadlibplist-58151b6cd801435d79145907cf6ef779d21573d3.tar.gz
libplist-58151b6cd801435d79145907cf6ef779d21573d3.tar.bz2
Fix crash when converting plists containing comments
Thanks to free2000fly for pointing this out. The issue was that XML plists with comments converted to binary plists would result in invalid binary nodes, thus converting back these binary plists resulted in a crash.
Diffstat (limited to 'src')
-rw-r--r--src/xplist.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xplist.c b/src/xplist.c
index 2b8c8f5..6147265 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -336,6 +336,10 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node)
if (!node)
break;
+ if (!xmlStrcmp(node->name, BAD_CAST("comment"))) {
+ continue;
+ }
+
data = plist_new_plist_data();
subnode = plist_new_node(data);
if (*plist_node)