1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix memory leak in ed25519_openssh_createkey

If q could not be read from the input blob, the allocated ec_key
structure was not freed.
This commit is contained in:
Tim Kosse 2017-01-23 18:46:42 +01:00 committed by Simon Tatham
parent 4548f22b38
commit e882b49051

View File

@ -2029,10 +2029,10 @@ static void *ed25519_openssh_createkey(const struct ssh_signkey *self,
}
getstring((const char**)blob, len, &q, &qlen);
if (!q)
return NULL;
if (qlen != 64)
if (!q || qlen != 64) {
ecdsa_freekey(ec);
return NULL;
}
ec->privateKey = bignum_from_bytes_le((const unsigned char *)q, 32);