jscript: Avoid use after free in JSON_parse().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9e725a6d58
commit
6b22f2bd60
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue