Commit 6b22f2bd authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

jscript: Avoid use after free in JSON_parse().

parent 9e725a6d
...@@ -291,16 +291,14 @@ static HRESULT JSON_parse(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsign ...@@ -291,16 +291,14 @@ static HRESULT JSON_parse(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsign
parse_ctx.end = buf + jsstr_length(str); parse_ctx.end = buf + jsstr_length(str);
parse_ctx.ctx = ctx; parse_ctx.ctx = ctx;
hres = parse_json_value(&parse_ctx, &ret); hres = parse_json_value(&parse_ctx, &ret);
if(SUCCEEDED(hres) && skip_spaces(&parse_ctx)) {
FIXME("syntax error\n");
hres = E_FAIL;
}
jsstr_release(str); jsstr_release(str);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
if(skip_spaces(&parse_ctx)) {
FIXME("syntax error\n");
jsval_release(ret);
return E_FAIL;
}
if(r) if(r)
*r = ret; *r = ret;
else else
......
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