authpf: do not sprintf to a null pointer
The fgetln loop will terminate with buf = NULL at EOF. Reported by: GCC Reviewed by: kp MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39947
This commit is contained in:
parent
d411c1d696
commit
81f964e2ff
@ -566,9 +566,8 @@ allowed_luser(struct passwd *pw)
|
|||||||
syslog(LOG_INFO, "denied access to %s: not listed in %s",
|
syslog(LOG_INFO, "denied access to %s: not listed in %s",
|
||||||
pw->pw_name, PATH_ALLOWFILE);
|
pw->pw_name, PATH_ALLOWFILE);
|
||||||
|
|
||||||
/* reuse buf */
|
fputs("\n\nSorry, you are not allowed to use this facility!\n",
|
||||||
sprintf(buf, "%s", "\n\nSorry, you are not allowed to use this facility!\n");
|
stdout);
|
||||||
fputs(buf, stdout);
|
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user