summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-03-23 22:21:16 +0000
committerwpaul <wpaul@FreeBSD.org>1995-03-23 22:21:16 +0000
commit77a782d587a39905e0b59d730a755c5eab1c5951 (patch)
tree6e6a85afa0d6cdcc76e68fc6e9975aea6555a93f /lib
parentec2490897f576e1387cd3df823a5a08fc070bede (diff)
downloadFreeBSD-src-77a782d587a39905e0b59d730a755c5eab1c5951.zip
FreeBSD-src-77a782d587a39905e0b59d730a755c5eab1c5951.tar.gz
Don't let setnetgrent() operate on a null or empty group name: it can
tickle a bug in ypserv and make a serious mess of things.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getnetgrent.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c
index a7ab735c..68e5ebd 100644
--- a/lib/libc/gen/getnetgrent.c
+++ b/lib/libc/gen/getnetgrent.c
@@ -96,6 +96,10 @@ void
setnetgrent(group)
char *group;
{
+ /* Sanity check: no null group names allowed! */
+
+ if (group == NULL || *group == '\0')
+ return;
if (grouphead.gr == (struct netgrp *)0 ||
strcmp(group, grouphead.grname)) {
endnetgrent();
OpenPOWER on IntegriCloud