Handle Android libc returning NULL pw->pw_passwd
Reported by Luke Dashjr
This commit is contained in:
parent
5953c14300
commit
be2866d620
2
misc.c
2
misc.c
|
@ -445,7 +445,7 @@ pwcopy(struct passwd *pw)
|
|||
struct passwd *copy = xcalloc(1, sizeof(*copy));
|
||||
|
||||
copy->pw_name = xstrdup(pw->pw_name);
|
||||
copy->pw_passwd = xstrdup(pw->pw_passwd);
|
||||
copy->pw_passwd = xstrdup(pw->pw_passwd == NULL ? "*" : pw->pw_passwd);
|
||||
#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
|
||||
copy->pw_gecos = xstrdup(pw->pw_gecos);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue