1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
14 const char *FileName
= "big-file.txt";
15 FILE *f
= fopen(FileName
, "w");
17 // This is the biggest file possible unless CopyFileToErr() uses Puts()
18 fprintf(f
, "%2147483646s", "2Gb-2");
20 // This makes the file too big if CopyFileToErr() uses fprintf("%s", <file>)
21 fprintf(f
, "THIS LINE RESPONSIBLE FOR EXCEEDING 2Gb FILE SIZE\n");
24 // Should now because CopyFileToErr() now uses Puts()
25 fuzzer::CopyFileToErr(FileName
);
27 // File is >2Gb so clean up