From: Karel Zak Date: Mon, 29 May 2017 11:25:36 +0000 (+0200) Subject: wall: make sure with not referencing a null pointer X-Git-Tag: v2.30~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4cb2b48f9ad7dc2fe925ea23ccc8dba24260c9e;p=thirdparty%2Futil-linux.git wall: make sure with not referencing a null pointer Signed-off-by: Karel Zak --- diff --git a/term-utils/wall.c b/term-utils/wall.c index 6dec05c12b..a9dde15beb 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;