mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 10:42:45 +00:00
Set the pw_class field to NULL when scanning the non-master passwd file.
This avoids a null pointer deref in pw_dup(), which assumes that all pointers are either NULL or valid.
This commit is contained in:
parent
75b9becc2c
commit
cbc397fd10
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336619
@ -170,7 +170,8 @@ __pw_scan(char *bp, struct passwd *pw, int flags)
|
||||
if (p[0])
|
||||
pw->pw_fields |= _PWF_EXPIRE;
|
||||
pw->pw_expire = atol(p);
|
||||
}
|
||||
} else
|
||||
pw->pw_class = NULL;
|
||||
if (!(pw->pw_gecos = strsep(&bp, ":"))) /* gecos */
|
||||
goto fmt;
|
||||
if (pw->pw_gecos[0])
|
||||
|
Loading…
Reference in New Issue
Block a user