From f6b028857bf9fa2580d6743982e09e299c1e2ee7 Mon Sep 17 00:00:00 2001 From: yasuoka Date: Mon, 19 Oct 2015 07:58:28 +0000 Subject: [PATCH] Avoid a NULL dereference when getgrnam_r() returns NULL for `result'. --- usr.sbin/radiusd/radiusd_bsdauth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.20.1