Commit d93712fe authored by Santino Mazza's avatar Santino Mazza Committed by Alexandre Julliard

jscript: Return ParseProcedureText when compile fails.

This prevents crashes when there is an invalid script inside a tag property. Because ParseProcedureText calls release_bytecode without checking if compile_script failed, "code" is not set, and this leads to a crash when release_bytecode tries to access it. Signed-off-by: 's avatarSantino Mazza <mazzasantino1206@gmail.com>
parent a0cac2e0
......@@ -1197,9 +1197,12 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars
enter_script(This->ctx, &ei);
hres = compile_script(This->ctx, pstrCode, dwSourceContextCookie, ulStartingLineNumber, pstrFormalParams,
pstrDelimiter, FALSE, This->is_encode, item, &code);
if(SUCCEEDED(hres))
hres = create_source_function(This->ctx, code, &code->global_code, NULL, &dispex);
if(FAILED(hres))
return leave_script(This->ctx, hres);
hres = create_source_function(This->ctx, code, &code->global_code, NULL, &dispex);
release_bytecode(code);
hres = leave_script(This->ctx, hres);
if(FAILED(hres))
return hres;
......
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