skill: Do not scan past the null-terminator in check_proc().
This commit is contained in:
parent
a9ee0bf622
commit
7367c4b1fd
7
skill.c
7
skill.c
@ -209,8 +209,11 @@ static void check_proc(int pid, struct run_time_conf_t *run_time)
|
|||||||
*tmp++ = '\0';
|
*tmp++ = '\0';
|
||||||
i = 5;
|
i = 5;
|
||||||
while (i--)
|
while (i--)
|
||||||
while (*tmp++ != ' ')
|
do {
|
||||||
/* scan to find tty */ ;
|
if (!*tmp)
|
||||||
|
goto closure;
|
||||||
|
/* scan to find tty */
|
||||||
|
} while (*tmp++ != ' ');
|
||||||
tty = atoi(tmp);
|
tty = atoi(tmp);
|
||||||
if (ttys) {
|
if (ttys) {
|
||||||
i = tty_count;
|
i = tty_count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user