summaryrefslogtreecommitdiffstats
path: root/src/xplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xplist.c')
-rw-r--r--src/xplist.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/xplist.c b/src/xplist.c
index 6100afc..73e2b9f 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -1216,7 +1216,17 @@ static plist_err_t node_from_xml(parse_ctx ctx, plist_t *plist)
1216 goto handle_closing; 1216 goto handle_closing;
1217 } 1217 }
1218 plist_data_t data = plist_new_plist_data(); 1218 plist_data_t data = plist_new_plist_data();
1219 if (!data) {
1220 PLIST_XML_ERR("failed to allocate plist data\n");
1221 ctx->err = PLIST_ERR_NO_MEM;
1222 goto err_out;
1223 }
1219 subnode = plist_new_node(data); 1224 subnode = plist_new_node(data);
1225 if (!subnode) {
1226 PLIST_XML_ERR("failed to create node\n");
1227 ctx->err = PLIST_ERR_NO_MEM;
1228 goto err_out;
1229 }
1220 1230
1221 if (!strcmp(tag, XPLIST_DICT)) { 1231 if (!strcmp(tag, XPLIST_DICT)) {
1222 data->type = PLIST_DICT; 1232 data->type = PLIST_DICT;
@@ -1425,6 +1435,12 @@ static plist_err_t node_from_xml(parse_ctx ctx, plist_t *plist)
1425 size_t size = tp->length; 1435 size_t size = tp->length;
1426 if (size > 0) { 1436 if (size > 0) {
1427 data->buff = base64decode(str_content, &size); 1437 data->buff = base64decode(str_content, &size);
1438 if (!data->buff) {
1439 text_parts_free((text_part_t*)first_part.next);
1440 PLIST_XML_ERR("failed to decode base64 stream\n");
1441 ctx->err = PLIST_ERR_NO_MEM;
1442 goto err_out;
1443 }
1428 data->length = size; 1444 data->length = size;
1429 } 1445 }
1430 1446