Ignore large fuzzer inputs. (#1085)

This commit is contained in:
Jon Meow
2022-02-23 11:25:34 -08:00
committed by GitHub
parent 656e746bcb
commit c01634ac8f
2 changed files with 15 additions and 0 deletions
+6
View File
@@ -18,6 +18,12 @@ namespace Carbon::Testing {
// NOLINTNEXTLINE: Match the documented fuzzer entry point declaration style.
extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
std::size_t size) {
// Ignore large inputs.
// TODO: See tokenized_buffer_fuzzer.cpp.
if (size > 100000) {
return 0;
}
auto source = SourceBuffer::CreateFromText(
llvm::StringRef(reinterpret_cast<const char*>(data), size));