skill: Do not scan past the null-terminator in check_proc().

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

View File

@ -209,8 +209,11 @@ static void check_proc(int pid, struct run_time_conf_t *run_time)
*tmp++ = '\0';
i = 5;
while (i--)
while (*tmp++ != ' ')
/* scan to find tty */ ;
do {
if (!*tmp)
goto closure;
/* scan to find tty */
} while (*tmp++ != ' ');
tty = atoi(tmp);
if (ttys) {
i = tty_count;