wall: make sure with not referencing a null pointer

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2017-05-29 13:25:36 +02:00
parent 2e2cfdae79
commit b4cb2b48f9
1 changed files with 3 additions and 0 deletions

View File

@ -147,6 +147,9 @@ static int is_gr_member(const char *login, const struct group_workspace *buf)
int rc;
pw = getpwnam(login);
if (!pw)
return 0;
if (buf->requested_group == pw->pw_gid)
return 1;