mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 12:14:10 +00:00
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: Santino Mazza <mazzasantino1206@gmail.com>
This commit is contained in:
parent
a0cac2e0d8
commit
d93712feee
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue