[openssh-commits] [openssh] 01/01: Check for NULL from malloc.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 10 13:42:33 AEDT 2017


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch V_7_4
in repository openssh.

commit 215af43cb2f7397523f4696756c2040c8083ec30
Author: Darren Tucker <dtucker at zip.com.au>
Date:   Fri Mar 10 13:40:18 2017 +1100

    Check for NULL from malloc.
    
    Part of bz#2687, from jjelen at redhat.com.
---
 auth-pam.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/auth-pam.c b/auth-pam.c
index 7d8b292..bc8e5e0 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';

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list