diff options
author | Darren Tucker <dtucker@zip.com.au> | 2017-03-10 03:40:18 +0100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2017-03-10 03:40:18 +0100 |
commit | bee0167be2340d8de4bdc1ab1064ec957c85a447 (patch) | |
tree | 419d549af0d1ac680a4eb598f8b1d83e30c66d2c /auth-pam.c | |
parent | If OSX is using launchd, remove screen no. (diff) | |
download | openssh-bee0167be2340d8de4bdc1ab1064ec957c85a447.tar.xz openssh-bee0167be2340d8de4bdc1ab1064ec957c85a447.zip |
Check for NULL from malloc.
Part of bz#2687, from jjelen at redhat.com.
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/auth-pam.c b/auth-pam.c index 7d8b2926b..bc8e5e02d 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -830,6 +830,8 @@ fake_password(const char *wire_password) fatal("%s: password length too long: %zu", __func__, l); ret = malloc(l + 1); + if (ret == NULL) + return NULL; for (i = 0; i < l; i++) ret[i] = junk[i % (sizeof(junk) - 1)]; ret[i] = '\0'; |