summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-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