As reported by cppcheck: [src/superfluous.c:238] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null. [src/superfluous.c:239] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null. [src/superfluous.c:240] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.
The patch is adding a test to check if variable aicon exists.
---
src/superfluous.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/superfluous.c b/src/superfluous.c
index 0883cc1..4e30542 100644
--- a/src/superfluous.c
+++ b/src/superfluous.c
@@ -195,8 +195,11 @@ static void doAppBounce(void *arg)
AppBouncerData *data = (AppBouncerData*)arg;
WAppIcon *aicon = data->wapp->app_icon;
+ if (!aicon)
+ return;
+
reinit:
- if (aicon && data->wapp->refcount > 1) {
+ if (data->wapp->refcount > 1) {
if (wPreferences.raise_appicons_when_bouncing)
XRaiseWindow(dpy, aicon->icon->core->window);
0003-wmaker-superfluous.c-possible-null-pointer-dereferen.patch
Description: Binary data
