1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-13 00:58:06 -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:
Ben Harris 2015-10-10 00:58:11 +01:00
parent 3a43bec44c
commit e170041a5d

View File

@ -768,6 +768,8 @@ static int rsa2_pubkey_bits(void *blob, int len)
int ret;
rsa = rsa2_newkey((char *) blob, len);
if (!rsa)
return -1;
ret = bignum_bitcount(rsa->modulus);
rsa2_freekey(rsa);