From 8d09af51b831bb3ae7ddc3d4599e82739d41d2ca Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 25 Apr 2015 12:44:20 +0200 Subject: [PATCH] wmaker: check return value for XGetWindowAttributes (Coverity #50032) As reported by Coverity, the return value for XGetWindowAttributes is usually checked in many places, because it is a good practice to ensure that it did work, but it was not checked when called in the function 'wClientCheckProperty'. Signed-off-by: Christophe CURIS --- src/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.c b/src/client.c index 99ed445c..9af875c1 100644 --- a/src/client.c +++ b/src/client.c @@ -483,8 +483,8 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) int foo; unsigned bar; - XGetWindowAttributes(dpy, wwin->client_win, &attribs); - wClientGetNormalHints(wwin, &attribs, False, &foo, &foo, &bar, &bar); + if (XGetWindowAttributes(dpy, wwin->client_win, &attribs) != 0) + wClientGetNormalHints(wwin, &attribs, False, &foo, &foo, &bar, &bar); /* TODO: should we check for consistency of the current * size against the new geometry hints? */ }