summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2021-05-17 09:40:23 +1000
committerDamien Miller <djm@mindrot.org>2021-05-17 09:41:46 +1000
commitbe2866d6207b090615ff083c9ef212b603816a56 (patch)
tree0f7d37a08bcb3204387d0071026a696b2d2b30fb /misc.c
parent5953c143008259d87342fb5155bd0b8835ba88e5 (diff)
downloadopenssh-git-be2866d6207b090615ff083c9ef212b603816a56.tar.gz
Handle Android libc returning NULL pw->pw_passwd
Reported by Luke Dashjr
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index b0ece244..36f26ccb 100644
--- a/misc.c
+++ b/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