mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Fixed possible null pointer dereference
The new function 'unpaint_app_icon' checks its argument 'wapp' aginst NULL, however it does dereference the pointer beforehand, which will end up in a crash if the null-pointer case occurs.
This commit is contained in:
committed by
Carlos R. Mafra
parent
baecab089c
commit
a2d2f76bd0
@@ -160,8 +160,8 @@ void makeAppIconFor(WApplication *wapp)
|
|||||||
void unpaint_app_icon(WApplication *wapp)
|
void unpaint_app_icon(WApplication *wapp)
|
||||||
{
|
{
|
||||||
WAppIcon *aicon;
|
WAppIcon *aicon;
|
||||||
WScreen *scr = wapp->main_window_desc->screen_ptr;
|
WScreen *scr;
|
||||||
WDock *clip = scr->workspaces[scr->current_workspace]->clip;
|
WDock *clip;
|
||||||
|
|
||||||
if (!wapp || !wapp->app_icon)
|
if (!wapp || !wapp->app_icon)
|
||||||
return;
|
return;
|
||||||
@@ -172,6 +172,9 @@ void unpaint_app_icon(WApplication *wapp)
|
|||||||
if (aicon->docked)
|
if (aicon->docked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
scr = wapp->main_window_desc->screen_ptr;
|
||||||
|
clip = scr->workspaces[scr->current_workspace]->clip;
|
||||||
|
|
||||||
if (!clip || !aicon->attracted || !clip->collapsed)
|
if (!clip || !aicon->attracted || !clip->collapsed)
|
||||||
XUnmapWindow(dpy, aicon->icon->core->window);
|
XUnmapWindow(dpy, aicon->icon->core->window);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user