summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2017-03-10 13:40:18 +1100
committerDarren Tucker <dtucker@zip.com.au>2017-03-10 13:41:55 +1100
commit215af43cb2f7397523f4696756c2040c8083ec30 (patch)
treef08056e60b9fe96037208df24e5aaa18b14228d0
parent6f14de011f0d1586c607ef94270651722d0b4cb2 (diff)
Check for NULL from malloc.V_7_4
Part of bz#2687, from jjelen at redhat.com.
-rw-r--r--auth-pam.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/auth-pam.c b/auth-pam.c
index 7d8b2926..bc8e5e02 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';