aboutsummaryrefslogtreecommitdiff
path: root/test/fuzzers/standard_fuzzer.cpp
diff options
context:
space:
mode:
authorAndrew Bell <andrew.bell.ia@gmail.com>2019-05-15 10:47:03 -0400
committerAndrew Bell <andrew.bell.ia@gmail.com>2019-05-15 10:47:03 -0400
commit8f268409d37cea329d263e177b83e42f8384d3c7 (patch)
treec4d0f3dd19456600f718a6e0c8573577f433549b /test/fuzzers/standard_fuzzer.cpp
parent886ced02f0aaab5d66d16459435f7447cf976650 (diff)
parentd67203a6f76a74f5ac029ff052dbcc72e3b59624 (diff)
downloadPROJ-8f268409d37cea329d263e177b83e42f8384d3c7.tar.gz
PROJ-8f268409d37cea329d263e177b83e42f8384d3c7.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'test/fuzzers/standard_fuzzer.cpp')
-rw-r--r--test/fuzzers/standard_fuzzer.cpp8
1 files changed, 8 insertions, 0 deletions
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);