summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-01-02 00:53:20 +0100
committerGravatar Nikias Bassen2017-01-02 00:53:20 +0100
commit1cdb888575c6fc53fabe3575534ba99e3bb2c153 (patch)
tree9c3c2d83be5cd314b9d351127bf7af80d263757e /src
parent7a3ce8da05c3ce93121676e286ab4d40305b21bb (diff)
downloadlibplist-1cdb888575c6fc53fabe3575534ba99e3bb2c153.tar.gz
libplist-1cdb888575c6fc53fabe3575534ba99e3bb2c153.tar.bz2
xplist: Error out when invalid tags inside text nodes are encountered
Diffstat (limited to 'src')
-rw-r--r--src/xplist.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/xplist.c b/src/xplist.c
index a7d0722..ff065a9 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -587,15 +587,25 @@ static text_part_t* get_text_parts(parse_ctx ctx, const char* tag, size_t tag_le
}
ctx->pos += 3;
} else {
- PLIST_XML_ERR("Invalid special tag <[%.6s encountered\n", ctx->pos);
+ p = ctx->pos;
+ find_next(ctx, " \r\n\t>", 5, 1);
+ PLIST_XML_ERR("Invalid special tag '<[%.*s>' encountered inside '<%s>' tag\n", (int)(ctx->pos - p), p, tag);
ctx->err++;
return NULL;
}
+ } else {
+ p = ctx->pos;
+ find_next(ctx, " \r\n\t>", 5, 1);
+ PLIST_XML_ERR("Invalid special tag '<!%.*s>' encountered inside '<%s>' tag\n", (int)(ctx->pos - p), p, tag);
+ ctx->err++;
+ return NULL;
}
} else if (*ctx->pos == '/') {
break;
} else {
- PLIST_XML_ERR("Invalid tag %.10s inside %s tag\n", ctx->pos, tag);
+ p = ctx->pos;
+ find_next(ctx, " \r\n\t>", 5, 1);
+ PLIST_XML_ERR("Invalid tag '<%.*s>' encountered inside '<%s>' tag\n", (int)(ctx->pos - p), p, tag);
ctx->err++;
return NULL;
}