aboutsummaryrefslogtreecommitdiffstats
path: root/src/extra_tests/fuzzers/jigs/invert.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/extra_tests/fuzzers/jigs/invert.cpp')
-rw-r--r--src/extra_tests/fuzzers/jigs/invert.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/extra_tests/fuzzers/jigs/invert.cpp b/src/extra_tests/fuzzers/jigs/invert.cpp
index fcda5770e..63c140139 100644
--- a/src/extra_tests/fuzzers/jigs/invert.cpp
+++ b/src/extra_tests/fuzzers/jigs/invert.cpp
@@ -51,6 +51,9 @@ BigInt inverse_mod_ref(const BigInt& n, const BigInt& mod)
void fuzz(const uint8_t in[], size_t len)
{
+ if(len % 2 == 1 || len > 2*4096/8)
+ return;
+
const BigInt x = BigInt::decode(in, len / 2);
BigInt mod = BigInt::decode(in + len / 2, len / 2);