aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-11 14:46:33 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-11 14:46:33 -0500
commit11eaf208c0aaa7c252ead6343ea65a3576227d69 (patch)
treeae80ea415181239c80323c87469c44b50a553ee5 /src
parent2ed4a3e61e76179b6aa108c379236b3a2173d3e8 (diff)
parenta7ca71cf6b2fb46b049442569188ce046cfd6c34 (diff)
downloadtor-11eaf208c0aaa7c252ead6343ea65a3576227d69.tar.gz
tor-11eaf208c0aaa7c252ead6343ea65a3576227d69.zip
Merge branch 'bug24247_032'
Diffstat (limited to 'src')
-rw-r--r--src/test/fuzz/fuzzing_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/fuzz/fuzzing_common.c b/src/test/fuzz/fuzzing_common.c
index d5c71859b5..1d54e41dbd 100644
--- a/src/test/fuzz/fuzzing_common.c
+++ b/src/test/fuzz/fuzzing_common.c
@@ -25,8 +25,9 @@ mock_crypto_pk_public_checksig__nocheck(const crypto_pk_t *env, char *to,
(void)fromlen;
/* We could look at from[0..fromlen-1] ... */
tor_assert(tolen >= crypto_pk_keysize(env));
- memset(to, 0x01, 20);
- return 20;
+ size_t siglen = MIN(20, crypto_pk_keysize(env));
+ memset(to, 0x01, siglen);
+ return (int)siglen;
}
static int