From: ed@s5h.net Date: Wed, 21 Aug 2019 19:47:11 +0000 (+0100) Subject: sgetpwent.c/sgetgrent.c: check for additional data at end of line X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=558977bb2b22d8b19d30d592ff7d2a975c8b69dd;p=shadow sgetpwent.c/sgetgrent.c: check for additional data at end of line --- diff --git a/lib/sgetpwent.c b/lib/sgetpwent.c index 293aabe2..befdd916 100644 --- a/lib/sgetpwent.c +++ b/lib/sgetpwent.c @@ -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 * the entry is invalid. Also, the UID and GID must be non-blank.