mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
r17613@catbus: nickm | 2008-01-14 13:52:44 -0500
Do not segfault if symetric key generation somehow fails in crypto_hybrid_encrypt. svn:r13132
This commit is contained in:
+4
-2
@@ -858,8 +858,10 @@ crypto_pk_public_hybrid_encrypt(crypto_pk_env_t *env,
|
||||
crypto_free_cipher_env(cipher);
|
||||
return outlen + symlen;
|
||||
err:
|
||||
memset(buf, 0, pkeylen);
|
||||
tor_free(buf);
|
||||
if (buf) {
|
||||
memset(buf, 0, pkeylen);
|
||||
tor_free(buf);
|
||||
}
|
||||
if (cipher) crypto_free_cipher_env(cipher);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user