diff --git a/nis/nis_local_names.c b/nis/nis_local_names.c index 080dcf88bd..218764f32e 100644 --- a/nis/nis_local_names.c +++ b/nis/nis_local_names.c @@ -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);