skill: check return value of getline
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
2320dc9cdb
commit
c6e3ec4602
3
skill.c
3
skill.c
@ -98,7 +98,8 @@ static void hurt_proc(int tty, int uid, int pid, const char *restrict const cmd,
|
|||||||
fprintf(stderr, "%-8s %-8s %5d %-16.16s ? ",
|
fprintf(stderr, "%-8s %-8s %5d %-16.16s ? ",
|
||||||
(char *)dn_buf, user_from_uid(uid), pid, cmd);
|
(char *)dn_buf, user_from_uid(uid), pid, cmd);
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
getline(&buf, &len, stdin);
|
if (getline(&buf, &len, stdin) == -1)
|
||||||
|
return;
|
||||||
if (rpmatch(buf) < 1) {
|
if (rpmatch(buf) < 1) {
|
||||||
free(buf);
|
free(buf);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user