Commit 234c41cd authored by Nikias Bassen's avatar Nikias Bassen

xplist: Fix OOB read when parsing DOCTYPE

parent fa4d1ce8
...@@ -875,7 +875,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth) ...@@ -875,7 +875,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth)
} }
if (embedded_dtd) { if (embedded_dtd) {
find_str(ctx, "]>", 2, 1); find_str(ctx, "]>", 2, 1);
if (strncmp(ctx->pos, "]>", 2)) { if (ctx->pos >= ctx->end || strncmp(ctx->pos, "]>", 2)) {
PLIST_XML_ERR("Couldn't find end of DOCTYPE\n"); PLIST_XML_ERR("Couldn't find end of DOCTYPE\n");
ctx->err++; ctx->err++;
goto err_out; goto err_out;
......
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