mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-27 00:42:32 +01:00
wmaker: add check for null pointer in wAppIconCreateForDock (Coverity #50053)
As pointed by Coverity, there is in the same procedure a check for null pointer before use, and later a direct use without check. In most case, the pointer is not null, but it one case it is hard to be sure that the pointer cannot be null, so it's safer to just add a check there also. Took opportunity to swap the order of the arguments in the if, because if the config flag is false it is not necessary to spend time on doing the more expensive strcmp. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
63733c9133
commit
1b00071c26
@@ -126,7 +126,7 @@ WAppIcon *wAppIconCreateForDock(WScreen *scr, const char *command, const char *w
|
||||
if (wm_instance)
|
||||
aicon->wm_instance = wstrdup(wm_instance);
|
||||
|
||||
if (strcmp(wm_class, "WMDock") == 0 && wPreferences.flags.clip_merged_in_dock)
|
||||
if (wPreferences.flags.clip_merged_in_dock && wm_class != NULL && strcmp(wm_class, "WMDock") == 0)
|
||||
tile = TILE_CLIP;
|
||||
aicon->icon = icon_create_for_dock(scr, command, wm_instance, wm_class, tile);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user