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:
parent
4548f22b38
commit
e882b49051
6
sshecc.c
6
sshecc.c
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user