diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-03-23 22:21:16 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-03-23 22:21:16 +0000 |
commit | 77a782d587a39905e0b59d730a755c5eab1c5951 (patch) | |
tree | 6e6a85afa0d6cdcc76e68fc6e9975aea6555a93f /lib/libc/gen/getnetgrent.c | |
parent | ec2490897f576e1387cd3df823a5a08fc070bede (diff) | |
download | FreeBSD-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/libc/gen/getnetgrent.c')
-rw-r--r-- | lib/libc/gen/getnetgrent.c | 4 |
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(); |