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

nickm at torproject.org nickm at torproject.org
Fri Nov 4 18:48:12 UTC 2016


commit 1a03edefbaf2f89489df86519b837b5bf8c5f18f
Author: Nick Mathewson <nickm at torproject.org>
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);





More information about the tor-commits mailing list