mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-16 12:03:03 -05:00
rsa2_pubkey_bits: Cope correctly with a NULL return from rsa2_newkey()
Dereferencing it is not correct. Bug found with the help of afl-fuzz.
This commit is contained in:
parent
63b47ed9d5
commit
7707aa24d6
2
sshrsa.c
2
sshrsa.c
@ -773,6 +773,8 @@ static int rsa2_pubkey_bits(const struct ssh_signkey *self,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
rsa = rsa2_newkey(self, (const char *) blob, len);
|
rsa = rsa2_newkey(self, (const char *) blob, len);
|
||||||
|
if (!rsa)
|
||||||
|
return -1;
|
||||||
ret = bignum_bitcount(rsa->modulus);
|
ret = bignum_bitcount(rsa->modulus);
|
||||||
rsa2_freekey(rsa);
|
rsa2_freekey(rsa);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user