summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/xplist.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/xplist.c b/src/xplist.c
index 7e39ea4..dc5213b 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -256,7 +256,7 @@ static plist_err_t node_to_xml(node_t node, bytearray_t **outbuf, uint32_t depth
256 /* append tag */ 256 /* append tag */
257 str_buf_append(*outbuf, "<", 1); 257 str_buf_append(*outbuf, "<", 1);
258 str_buf_append(*outbuf, tag, tag_len); 258 str_buf_append(*outbuf, tag, tag_len);
259 if (node_data->type == PLIST_STRING || node_data->type == PLIST_KEY) { 259 if ((node_data->type == PLIST_STRING || node_data->type == PLIST_KEY) && node_data->length > 0) {
260 size_t j; 260 size_t j;
261 size_t len; 261 size_t len;
262 off_t start = 0; 262 off_t start = 0;
@@ -1274,6 +1274,14 @@ static plist_err_t node_from_xml(parse_ctx ctx, plist_t *plist)
1274 data->length = length; 1274 data->length = length;
1275 } 1275 }
1276 } else { 1276 } else {
1277 if (!strcmp(tag, "key") && !keyname && parent && (plist_get_node_type(parent) == PLIST_DICT)) {
1278 keyname = strdup("");
1279 free(tag);
1280 tag = NULL;
1281 plist_free(subnode);
1282 subnode = NULL;
1283 continue;
1284 }
1277 data->strval = strdup(""); 1285 data->strval = strdup("");
1278 data->length = 0; 1286 data->length = 0;
1279 } 1287 }