mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-15 18:18:05 -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. Conflicts: sshrsa.c
This commit is contained in:
parent
3a43bec44c
commit
e170041a5d
2
sshrsa.c
2
sshrsa.c
@ -768,6 +768,8 @@ static int rsa2_pubkey_bits(void *blob, int len)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
rsa = rsa2_newkey((char *) blob, len);
|
rsa = rsa2_newkey((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