From 5e8fb617b8f7857693e7b41f56eaa6767ed6a54d Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 28 Nov 2016 12:09:42 +0100 Subject: xplist: Fix parsing of adjacent nodes without whitespace between them The context position counter was increased after encountering a closing node, e.g. '' or after a closing '' node. When a node followed it directly without any whitespace inbetween, e.g. , parsing would fail since the parser would look at 'key>' instead of '' for the next node to be parsed. --- src/xplist.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xplist.c b/src/xplist.c index 0cb891c..dc824e2 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -621,6 +621,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist) if (*ctx->pos != '<') { PLIST_XML_ERR("Failed to parse XML. Expected: opening tag, found: '%s', pos: %s\n", start, ctx->pos); ctx->pos = ctx->end; + ctx->err++; break; } ctx->pos++; @@ -828,7 +829,6 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist) free(tag); plist_free(subnode); subnode = NULL; - ctx->pos++; continue; } else { data->strval = str; @@ -953,7 +953,6 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist) break; } } - ctx->pos++; } if (ctx->err) { plist_free(*plist); -- cgit v1.1-32-gdbae