Commit 19b79a93 authored by Nikias Bassen's avatar Nikias Bassen

xplist: Fix UaF in code checking for closing tag

parent d98ef414
...@@ -1135,7 +1135,6 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth) ...@@ -1135,7 +1135,6 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth)
free(keyname); free(keyname);
return; return;
} }
free(tag);
if (subnode && !closing_tag) { if (subnode && !closing_tag) {
/* parse sub nodes for structured types */ /* parse sub nodes for structured types */
if (data->type == PLIST_DICT || data->type == PLIST_ARRAY) { 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,6 +1143,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth)
node_from_xml(ctx, &subnode, depth+1); node_from_xml(ctx, &subnode, depth+1);
if (ctx->err) { if (ctx->err) {
/* make sure to bail out if parsing failed */ /* make sure to bail out if parsing failed */
free(tag);
free(keyname); free(keyname);
return; return;
} }
...@@ -1212,8 +1212,8 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth) ...@@ -1212,8 +1212,8 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth)
ctx->err++; ctx->err++;
break; break;
} }
break;
} }
free(tag);
free(keyname); free(keyname);
keyname = NULL; keyname = NULL;
plist_free(subnode); plist_free(subnode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment