]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix buffer size in sha512 unit test
authorNick Mathewson <nickm@torproject.org>
Thu, 26 Nov 2015 15:00:12 +0000 (10:00 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 26 Nov 2015 15:00:12 +0000 (10:00 -0500)
Nobody likes a stack overflow, even in unit tests.

Closes 17699; but not in any released tor.

src/test/test_crypto.c

index fcce2c52cbe7c93308cb91bc524ca9e040ef060c..204c066c71e11654c1fb3e446b34cae3a9d16c14 100644 (file)
@@ -287,7 +287,7 @@ test_crypto_sha(void *arg)
   char key[160];
   char digest[32];
   char data[50];
-  char d_out1[DIGEST_LEN], d_out2[DIGEST256_LEN];
+  char d_out1[DIGEST_LEN], d_out2[DIGEST512_LEN];
   char *mem_op_hex_tmp=NULL;
 
   /* Test SHA-1 with a test vector from the specification. */