skill: Check return value of str*chr() in check_proc().

This commit is contained in:
Qualys Security Advisory 1970-01-01 00:00:00 +00:00 committed by Craig Small
parent 52673d2fc7
commit a9ee0bf622

View File

@ -204,6 +204,8 @@ static void check_proc(int pid, struct run_time_conf_t *run_time)
goto closure;
buf[len] = '\0';
tmp = strrchr(buf, ')');
if (!tmp)
goto closure;
*tmp++ = '\0';
i = 5;
while (i--)
@ -218,7 +220,10 @@ static void check_proc(int pid, struct run_time_conf_t *run_time)
if (i == -1)
goto closure;
}
tmp = strchr(buf, '(') + 1;
tmp = strchr(buf, '(');
if (!tmp)
goto closure;
tmp++;
if (cmds) {
i = cmd_count;
/* fast comparison trick -- useful? */