From b4f3eaf082064cdebd6951e95b2e26d10a384ab9 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 4 Nov 2014 20:26:41 +0000 Subject: check stat return value (fixes coverity 1109842) --- gtk/theme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gtk/theme.c') diff --git a/gtk/theme.c b/gtk/theme.c index 8612c3948..e7f292b88 100644 --- a/gtk/theme.c +++ b/gtk/theme.c @@ -111,8 +111,8 @@ static bool nsgtk_theme_verify(const char *themename) buf); /* check every directory */ if (access(testfile, R_OK) == 0) { - stat(testfile, &sta); - if (S_ISDIR(sta.st_mode)) { + if ((stat(testfile, &sta) == 0) && + (S_ISDIR(sta.st_mode))) { buf[strlen(buf)] = '\n'; /* "\0\0" -> "\n\0" */ strcat(filecontent, buf); -- cgit v1.2.3