From: yasuoka Date: Mon, 19 Oct 2015 07:58:28 +0000 (+0000) Subject: Avoid a NULL dereference when getgrnam_r() returns NULL for `result'. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f6b028857bf9fa2580d6743982e09e299c1e2ee7;p=openbsd Avoid a NULL dereference when getgrnam_r() returns NULL for `result'. --- diff --git a/usr.sbin/radiusd/radiusd_bsdauth.c b/usr.sbin/radiusd/radiusd_bsdauth.c index b610a5404d4..c7f83078f41 100644 --- a/usr.sbin/radiusd/radiusd_bsdauth.c +++ b/usr.sbin/radiusd/radiusd_bsdauth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radiusd_bsdauth.c,v 1.4 2015/07/30 08:46:04 yasuoka Exp $ */ +/* $OpenBSD: radiusd_bsdauth.c,v 1.5 2015/10/19 07:58:28 yasuoka Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko @@ -167,7 +167,7 @@ main(int argc, char *argv[]) pw = getpwnam(user); if (getgrnam_r(group, &gr0, g_buf, - sizeof(g_buf), &gr) == -1) + sizeof(g_buf), &gr) == -1 || gr == NULL) goto group_done; if (gr->gr_gid == pw->pw_gid) {