Kaydet (Commit) dbfc8777 authored tarafından Christopher Copits's avatar Christopher Copits Kaydeden (comit) Michael Stahl

fdo#53521 Crash when running BASIC's "shell()" with a non-existent program

The problem is that the process handle is freed regardless of whether osl_executeProcess was successful or not. Therefore, a segmentation fault would result, as a random memory address would be freed. This patch checks whether osl_executeProcess was successful. If it was, then it frees the handle; if it wasn't successful, the memory is not freed.

Change-Id: Ic3af07be06e7af7730a3bcb1680c659a88b66af3
Reviewed-on: https://gerrit.libreoffice.org/1530Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst b380744c
...@@ -3534,7 +3534,11 @@ RTLFUNC(Shell) ...@@ -3534,7 +3534,11 @@ RTLFUNC(Shell)
NULL, 0, NULL, 0,
&pApp ) == osl_Process_E_None; &pApp ) == osl_Process_E_None;
osl_freeProcessHandle( pApp ); // 53521 only free process handle on success
if (bSucc)
{
osl_freeProcessHandle( pApp );
}
for(int j = 0; i < nParamCount; i++) for(int j = 0; i < nParamCount; i++)
{ {
......
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