[tor-commits] [tor/maint-0.2.7] Fix 17251: avoid integer overflow in test_crypto_slow

nickm at torproject.org nickm at torproject.org
Tue Oct 6 13:06:52 UTC 2015


commit f7ce93d97949fe0897bf8f1b2e95da73c620ff8a
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Oct 6 08:58:03 2015 -0400

    Fix 17251: avoid integer overflow in test_crypto_slow
---
 changes/bug17251            |    3 +++
 src/test/test_crypto_slow.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/changes/bug17251 b/changes/bug17251
new file mode 100644
index 0000000..edd7739
--- /dev/null
+++ b/changes/bug17251
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compilation):
+    - Fix an integer overflow warning in test_crypto_slow.c.
+      Fixes bug 17251; bugfix on 0.2.7.2-alpha.
diff --git a/src/test/test_crypto_slow.c b/src/test/test_crypto_slow.c
index d0f50f8..853a08d 100644
--- a/src/test/test_crypto_slow.c
+++ b/src/test/test_crypto_slow.c
@@ -217,7 +217,7 @@ test_libscrypt_eq_openssl(void *arg)
   memset(buf2,0,64);
 
   N = 1048576;
-  maxmem = 2 * 1024 * 1024 * 1024; // 2 GB
+  maxmem = 2 * 1024 * 1024 * (uint64_t)1024; // 2 GB
 
   libscrypt_retval =
   libscrypt_scrypt((const uint8_t *)"pleaseletmein",





More information about the tor-commits mailing list