]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Check for NULL from malloc. V_7_4 anongit/V_7_4 github-selfhosted/V_7_4 github/V_7_4
authorDarren Tucker <dtucker@zip.com.au>
Fri, 10 Mar 2017 02:40:18 +0000 (13:40 +1100)
committerDarren Tucker <dtucker@zip.com.au>
Fri, 10 Mar 2017 02:41:55 +0000 (13:41 +1100)
Part of bz#2687, from jjelen at redhat.com.

auth-pam.c

index 7d8b2926b571f91ee3751b673b6808872818ebb3..bc8e5e02d8349765e0b5be928bb6020e63097bbd 100644 (file)
@@ -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';