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.
This commit is contained in:
wpaul 1995-03-23 22:21:16 +00:00
parent ec2490897f
commit 77a782d587

View File

@ -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();