mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04: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
1 changed files with 2 additions and 1 deletions
|
|
@ -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 a new issue