[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix a buffer overflow in setup_cfg() in src/test/test_voting_flags.c



commit c11247e957ae8e3fb253aac86196dcef13dac92c
Author: Kris Katterjohn <katterjohn@xxxxxxxxx>
Date:   Sun Dec 23 17:46:08 2018 -0600

    Fix a buffer overflow in setup_cfg() in src/test/test_voting_flags.c
    
    signed_descriptor_digest has a length of DIGEST_LEN but the memset
    used to fill it used DIGEST256_LEN.
    
    Signed-off-by: Kris Katterjohn <katterjohn@xxxxxxxxx>
---
 src/test/test_voting_flags.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_voting_flags.c b/src/test/test_voting_flags.c
index 0c4cedb51..c4c4c7354 100644
--- a/src/test/test_voting_flags.c
+++ b/src/test/test_voting_flags.c
@@ -35,7 +35,7 @@ setup_cfg(flag_vote_test_cfg_t *c)
   strlcpy(c->expected.nickname, "testing100", sizeof(c->expected.nickname));
 
   memset(c->ri.cache_info.identity_digest, 0xff, DIGEST_LEN);
-  memset(c->ri.cache_info.signed_descriptor_digest, 0xee, DIGEST256_LEN);
+  memset(c->ri.cache_info.signed_descriptor_digest, 0xee, DIGEST_LEN);
 
   c->ri.cache_info.published_on = c->now - 100;
   c->expected.published_on = c->now - 100;

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits