mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-11-27 05:46:36 +08:00
Check for NULL from malloc.
Part of bz#2687, from jjelen at redhat.com.
This commit is contained in:
parent
6f14de011f
commit
215af43cb2
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user