1
0
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:
Christophe CURIS
2012-10-09 01:19:15 +02:00
committed by Carlos R. Mafra
parent baecab089c
commit a2d2f76bd0

View File

@@ -160,8 +160,8 @@ void makeAppIconFor(WApplication *wapp)
void unpaint_app_icon(WApplication *wapp)
{
WAppIcon *aicon;
WScreen *scr = wapp->main_window_desc->screen_ptr;
WDock *clip = scr->workspaces[scr->current_workspace]->clip;
WScreen *scr;
WDock *clip;
if (!wapp || !wapp->app_icon)
return;
@@ -172,6 +172,9 @@ void unpaint_app_icon(WApplication *wapp)
if (aicon->docked)
return;
scr = wapp->main_window_desc->screen_ptr;
clip = scr->workspaces[scr->current_workspace]->clip;
if (!clip || !aicon->attracted || !clip->collapsed)
XUnmapWindow(dpy, aicon->icon->core->window);