spawn: Fix crash when called with an empty table.
The spawn code didn't properly handle the case where there is an empty command stream. In that case, no error is reported as there is simply nothing to do. The error message was probed and this caused an invalid read and crash. Fix #1033
This commit is contained in:
parent
b470f8dfcf
commit
b8eeb76608
4
spawn.c
4
spawn.c
|
@ -414,8 +414,12 @@ luaA_spawn(lua_State *L)
|
||||||
if(!argv || !argv[0])
|
if(!argv || !argv[0])
|
||||||
{
|
{
|
||||||
g_strfreev(argv);
|
g_strfreev(argv);
|
||||||
|
if (error) {
|
||||||
luaA_warn(L, "spawn: parse error: %s", error->message);
|
luaA_warn(L, "spawn: parse error: %s", error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
luaA_warn(L, "spawn: There is nothing to execute");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue