sgetpwent.c/sgetgrent.c: check for additional data at end of line

This commit is contained in:
ed@s5h.net 2019-08-21 20:47:11 +01:00 committed by Serge Hallyn
parent 332709da65
commit 558977bb2b

View File

@ -90,6 +90,11 @@ struct passwd *sgetpwent (const char *buf)
} }
} }
/* something at the end, columns over shot */
if( cp != NULL ) {
return( NULL );
}
/* /*
* There must be exactly NFIELDS colon separated fields or * There must be exactly NFIELDS colon separated fields or
* the entry is invalid. Also, the UID and GID must be non-blank. * the entry is invalid. Also, the UID and GID must be non-blank.