]> granicus.if.org Git - procps-ng/commitdiff
skill: Check the return value of fstat().
authorQualys Security Advisory <qsa@qualys.com>
Thu, 1 Jan 1970 00:00:00 +0000 (00:00 +0000)
committerCraig Small <csmall@enc.com.au>
Fri, 18 May 2018 21:32:21 +0000 (07:32 +1000)
skill.c

diff --git a/skill.c b/skill.c
index effd778888490843aab54436ccae4b1d6607773c..f32e918e620e777b15dd214f1a762a0617d6bc92 100644 (file)
--- a/skill.c
+++ b/skill.c
@@ -187,7 +187,8 @@ static void check_proc(int pid, struct run_time_conf_t *run_time)
                        xwarn(_("cannot open file %s"), buf);
                return;
        }
-       fstat(fd, &statbuf);
+       if (fstat(fd, &statbuf) != 0)
+               goto closure;
        if (uids) {
                /* check the EUID */
                i = uid_count;