summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-01-13 14:36:41 -0500
committerNick Mathewson <nickm@torproject.org>2011-01-15 11:49:25 -0500
commit115782bdbe42e4b3d5cb386d2939a883bc381d12 (patch)
treefacebd78bfcd426d3404999e5237c502fb34ebaa /src/or/networkstatus.c
parenta16902b9d4b0a912eb0a252bb945cbeaaa40dacb (diff)
downloadtor-115782bdbe42e4b3d5cb386d2939a883bc381d12.tar.gz
tor-115782bdbe42e4b3d5cb386d2939a883bc381d12.zip
Fix a heap overflow found by debuger, and make it harder to make that mistake again
Our public key functions assumed that they were always writing into a large enough buffer. In one case, they weren't. (Incorporates fixes from sebastian)
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 53e8a63ea3..7106294d54 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -362,6 +362,7 @@ networkstatus_check_voter_signature(networkstatus_t *consensus,
signed_digest = tor_malloc(signed_digest_len);
if (crypto_pk_public_checksig(cert->signing_key,
signed_digest,
+ signed_digest_len,
voter->signature,
voter->signature_len) != DIGEST_LEN ||
memcmp(signed_digest, consensus->networkstatus_digest, DIGEST_LEN)) {