]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wall: make sure with not referencing a null pointer
authorKarel Zak <kzak@redhat.com>
Mon, 29 May 2017 11:25:36 +0000 (13:25 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 29 May 2017 11:25:36 +0000 (13:25 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/wall.c

index 6dec05c12b68dd43bfe37dbbcca57ff1265d72f5..a9dde15beb227b5bbee3450a1090ec1bff6223cb 100644 (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;