summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2015-10-19 07:58:28 +0000
committeryasuoka <yasuoka@openbsd.org>2015-10-19 07:58:28 +0000
commitf6b028857bf9fa2580d6743982e09e299c1e2ee7 (patch)
treeafbc5524baff863d7675203d9b653f7b8936fa45
parentUpdate etc/mtree/BSD.x11.dist (freetype-2.6.1) (diff)
downloadwireguard-openbsd-f6b028857bf9fa2580d6743982e09e299c1e2ee7.tar.xz
wireguard-openbsd-f6b028857bf9fa2580d6743982e09e299c1e2ee7.zip
Avoid a NULL dereference when getgrnam_r() returns NULL for `result'.
-rw-r--r--usr.sbin/radiusd/radiusd_bsdauth.c4
1 files 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 <yasuoka@yasuoka.net>
@@ -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) {