summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-12-21 22:56:13 +0100
committerGravatar Nikias Bassen2016-12-21 22:56:13 +0100
commit19b79a93f5e45df7901091e9af6f2a6a6189c65b (patch)
tree9e3398e2df4d30625637f4f42f6cf0e084a19574
parentd98ef4146e4e796e267284f37e06c86e75fcf30f (diff)
downloadlibplist-19b79a93f5e45df7901091e9af6f2a6a6189c65b.tar.gz
libplist-19b79a93f5e45df7901091e9af6f2a6a6189c65b.tar.bz2
xplist: Fix UaF in code checking for closing tag
-rw-r--r--src/xplist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xplist.c b/src/xplist.c
index ec75226..68fd3ab 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -1135,7 +1135,6 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth)
1135 free(keyname); 1135 free(keyname);
1136 return; 1136 return;
1137 } 1137 }
1138 free(tag);
1139 if (subnode && !closing_tag) { 1138 if (subnode && !closing_tag) {
1140 /* parse sub nodes for structured types */ 1139 /* parse sub nodes for structured types */
1141 if (data->type == PLIST_DICT || data->type == PLIST_ARRAY) { 1140 if (data->type == PLIST_DICT || data->type == PLIST_ARRAY) {
@@ -1144,6 +1143,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth)
1144 node_from_xml(ctx, &subnode, depth+1); 1143 node_from_xml(ctx, &subnode, depth+1);
1145 if (ctx->err) { 1144 if (ctx->err) {
1146 /* make sure to bail out if parsing failed */ 1145 /* make sure to bail out if parsing failed */
1146 free(tag);
1147 free(keyname); 1147 free(keyname);
1148 return; 1148 return;
1149 } 1149 }
@@ -1212,8 +1212,8 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth)
1212 ctx->err++; 1212 ctx->err++;
1213 break; 1213 break;
1214 } 1214 }
1215 break;
1216 } 1215 }
1216 free(tag);
1217 free(keyname); 1217 free(keyname);
1218 keyname = NULL; 1218 keyname = NULL;
1219 plist_free(subnode); 1219 plist_free(subnode);