]> git.ipfire.org Git - thirdparty/tor.git/commit
Fix undefined behavior caused by memory overlap
authorcypherpunks <cypherpunks@torproject.org>
Fri, 17 Jul 2015 09:53:12 +0000 (11:53 +0200)
committerNick Mathewson <nickm@torproject.org>
Tue, 1 Dec 2015 03:02:22 +0000 (22:02 -0500)
commitbe0891667e12a223ebda02dac2ba4a855bef4e52
tree43cefb427ecef47a8c90b3a08fe6c977e8af0156
parent232ccc18c40f0d0302b2e21b0f67885c548f8e63
Fix undefined behavior caused by memory overlap

The tor_cert_get_checkable_sig function uses the signing key included in
the certificate (if available) when a separate public key is not given.

When the signature is valid, the tor_cert_checksig function copies the
public key from the checkable structure to the public key field of the
certificate signing key.

In situations where the separate public key is not given but the
certificate includes a signing key, the source and destination pointers
in the copy operation are equal and invoke undefined behavior.

Undefined behaviour is avoided by ensuring both pointers are different.
src/or/torcert.c