mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
screen:swap(): Avoid segfault on almost-deleted screens
When a screen is in the process of being removed, it is still valid, but no longer in the global list of screens (globalconf.screens). In this time frame, trying to swap screens could cause a NULL pointer dereference. Fix this by throwing a Lua error in this case instead. Fixes: https://github.com/awesomeWM/awesome/issues/2110 Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
65b6d12b44
commit
ea413969f3
1 changed files with 3 additions and 0 deletions
|
@ -1222,6 +1222,9 @@ luaA_screen_swap(lua_State *L)
|
|||
if(ref_s && ref_swap)
|
||||
break;
|
||||
}
|
||||
if(!ref_s || !ref_swap)
|
||||
return luaL_error(L, "Invalid call to screen:swap()");
|
||||
|
||||
/* swap ! */
|
||||
*ref_s = swap;
|
||||
*ref_swap = s;
|
||||
|
|
Loading…
Reference in a new issue