From 01e5e9c2c3fa1cf7a9747148dca22d59ff9839b6 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 17 Jun 2022 00:44:30 +0200 Subject: [PATCH] tests/fuzzers/rlp: avoid very large input (#25109) The oss-fuzz engine crashes due to stack overflow decoding a large nested structure into a interface{}. This PR limits the size of the input data, so should avoid such crashes. --- tests/fuzzers/rlp/rlp_fuzzer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/fuzzers/rlp/rlp_fuzzer.go b/tests/fuzzers/rlp/rlp_fuzzer.go index 18b36287b53c..ac02e1651d44 100644 --- a/tests/fuzzers/rlp/rlp_fuzzer.go +++ b/tests/fuzzers/rlp/rlp_fuzzer.go @@ -40,6 +40,9 @@ func Fuzz(input []byte) int { if len(input) == 0 { return 0 } + if len(input) > 500*1024 { + return 0 + } var i int {