From e658bbc00a11ac1599198b148144145ba2917f56 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 24 Mar 2019 13:07:00 +0100 Subject: fuzzer: limit input size to avoid useless testing of huge proj strings --- test/fuzzers/standard_fuzzer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/fuzzers/standard_fuzzer.cpp') diff --git a/test/fuzzers/standard_fuzzer.cpp b/test/fuzzers/standard_fuzzer.cpp index e1c3bbf3..11f8738e 100644 --- a/test/fuzzers/standard_fuzzer.cpp +++ b/test/fuzzers/standard_fuzzer.cpp @@ -64,6 +64,14 @@ int LLVMFuzzerInitialize(int* /*argc*/, char*** argv) int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) { + if( len > 1000 ) + { +#ifdef STANDALONE + fprintf(stderr, "Input too large\n"); +#endif + return 0; + } + /* We expect the blob to be 3 lines: */ /* source proj string\ndestination proj string\nx y */ char* buf_dup = (char*)malloc(len+1); -- cgit v1.2.3