nis: nis_local_group may read from __nisgroup[-1] (bug 28075)

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Florian Weimer 2021-07-12 07:58:07 +02:00
parent 83b7008e11
commit 70099c7763

View File

@ -31,6 +31,7 @@ nis_local_group (void)
char *cptr;
if (__nisgroup[0] == '\0'
&& (cptr = getenv ("NIS_GROUP")) != NULL
&& cptr[0] != '\0'
&& strlen (cptr) < NIS_MAXNAMELEN)
{
char *cp = stpcpy (__nisgroup, cptr);