From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 (+0000) Subject: skill: Check the return value of fstat(). X-Git-Tag: v3.3.15~114 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37547e9f5f246888cd3dce2f80e10282566220bd;p=procps-ng skill: Check the return value of fstat(). --- diff --git a/skill.c b/skill.c index effd7788..f32e918e 100644 --- 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;