mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Ensure signing_key is non-NULL before accessing one of its members
signing_key can be NULL in ed_key_init_from_file in routerkeys.c.
Discovered by clang 3.7 address sanitizer.
Fix on c03694938e
, not in any released version of Tor.
This commit is contained in:
parent
e0477de0e2
commit
383a27afc5
6
changes/bug16115-signing-key-NULL-check
Normal file
6
changes/bug16115-signing-key-NULL-check
Normal file
@ -0,0 +1,6 @@
|
||||
o Minor fixes (threads, comments):
|
||||
- Ensure signing_key is non-NULL before accessing one of its members
|
||||
signing_key can be NULL in ed_key_init_from_file in routerkeys.c.
|
||||
Discovered by clang 3.7 address sanitizer.
|
||||
Patch by "teor".
|
||||
Fix on c03694938ed0, not in any released version of Tor.
|
@ -152,7 +152,8 @@ ed_key_init_from_file(const char *fname, uint32_t flags,
|
||||
ED25519_PUBKEY_LEN)) {
|
||||
tor_log(severity, LD_OR, "Cert was for wrong key");
|
||||
bad_cert = 1;
|
||||
} else if (tor_cert_checksig(cert, &signing_key->pubkey, now) < 0 &&
|
||||
} else if (signing_key &&
|
||||
tor_cert_checksig(cert, &signing_key->pubkey, now) < 0 &&
|
||||
(signing_key || cert->cert_expired)) {
|
||||
tor_log(severity, LD_OR, "Can't check certificate");
|
||||
bad_cert = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user