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

[tor-commits] [tor/master] Fix a heap overrun in test_decode_plaintext



commit 1a03edefbaf2f89489df86519b837b5bf8c5f18f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Nov 4 14:28:19 2016 -0400

    Fix a heap overrun in test_decode_plaintext
---
 src/test/test_hs_descriptor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c
index 838d7cd..e406a80 100644
--- a/src/test/test_hs_descriptor.c
+++ b/src/test/test_hs_descriptor.c
@@ -987,6 +987,7 @@ test_decode_plaintext(void *arg)
     tt_int_op(HS_DESC_MAX_LEN, <, big);
     char *plaintext = tor_malloc_zero(big);
     memset(plaintext, 'a', big);
+    plaintext[big - 1] = '\0';
     ret = hs_desc_decode_plaintext(plaintext, &desc_plaintext);
     tor_free(plaintext);
     tt_int_op(ret, OP_EQ, -1);



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