diff options
author | Damien Miller <djm@mindrot.org> | 2021-05-17 09:40:23 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2021-05-17 09:41:46 +1000 |
commit | be2866d6207b090615ff083c9ef212b603816a56 (patch) | |
tree | 0f7d37a08bcb3204387d0071026a696b2d2b30fb | |
parent | 5953c143008259d87342fb5155bd0b8835ba88e5 (diff) |
Handle Android libc returning NULL pw->pw_passwd
Reported by Luke Dashjr
-rw-r--r-- | misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |