mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Add a missing error check. This fixes a bug that would cause pwd_mkdb to
dump core if invoked with an input file that looks like a password file but isn't (e.g. /etc/group). PR: 32378 Submitted by: Maxim Konovalov <maxim@macomnet.ru> MFC after: 1 week
This commit is contained in:
parent
fa083d279a
commit
a8adfe18ce
1 changed files with 2 additions and 1 deletions
|
|
@ -133,7 +133,8 @@ __pw_scan(char *bp, struct passwd *pw, int flags)
|
|||
pw->pw_gid = id;
|
||||
|
||||
if (flags & _PWSCAN_MASTER ) {
|
||||
pw->pw_class = strsep(&bp, ":"); /* class */
|
||||
if (!(pw->pw_class = strsep(&bp, ":"))) /* class */
|
||||
goto fmt;
|
||||
if(pw->pw_class[0]) pw->pw_fields |= _PWF_CLASS;
|
||||
|
||||
if (!(p = strsep(&bp, ":"))) /* change */
|
||||
|
|
|
|||
Loading…
Reference in a new issue