From: Damien Miller Date: Sun, 16 May 2021 23:40:23 +0000 (+1000) Subject: Handle Android libc returning NULL pw->pw_passwd X-Git-Tag: V_8_7_P1~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be2866d6207b090615ff083c9ef212b603816a56;p=thirdparty%2Fopenssh-portable.git Handle Android libc returning NULL pw->pw_passwd Reported by Luke Dashjr --- diff --git a/misc.c b/misc.c index b0ece2442..36f26ccb6 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