summaryrefslogtreecommitdiffstats
path: root/term-utils/wall.c
diff options
context:
space:
mode:
authorKarel Zak2017-05-29 13:25:36 +0200
committerKarel Zak2017-05-29 13:25:36 +0200
commitb4cb2b48f9ad7dc2fe925ea23ccc8dba24260c9e (patch)
tree635a981d7255cdcbdb01747024e27dd0dcd31cf4 /term-utils/wall.c
parentlibfdisk: fix variable shadowing (diff)
downloadkernel-qcow2-util-linux-b4cb2b48f9ad7dc2fe925ea23ccc8dba24260c9e.tar.gz
kernel-qcow2-util-linux-b4cb2b48f9ad7dc2fe925ea23ccc8dba24260c9e.tar.xz
kernel-qcow2-util-linux-b4cb2b48f9ad7dc2fe925ea23ccc8dba24260c9e.zip
wall: make sure with not referencing a null pointer
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/wall.c')
-rw-r--r--term-utils/wall.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/term-utils/wall.c b/term-utils/wall.c
index 6dec05c12..a9dde15be 100644
--- a/term-utils/wall.c
+++ b/term-utils/wall.c
@@ -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;