]> granicus.if.org Git - shadow/commitdiff
sgetpwent.c/sgetgrent.c: check for additional data at end of line
authored@s5h.net <ed@s5h.net>
Wed, 21 Aug 2019 19:47:11 +0000 (20:47 +0100)
committerSerge Hallyn <shallyn@cisco.com>
Fri, 4 Oct 2019 23:30:38 +0000 (18:30 -0500)
lib/sgetpwent.c

index 293aabe2f4f21e0a0e39881b83116ad49fc53d40..befdd9169a06859d3506270cd470c1a4980ec26f 100644 (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
         * the entry is invalid.  Also, the UID and GID must be non-blank.