]>
The Tcpdump Group git mirrors - libpcap/blob - testprogs/fuzz/onefile.c
854dceb8e40082cd9f4cb32145acc76ff1048232
5 int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
);
6 void fuzz_openFile(const char * name
);
8 int main(int argc
, char** argv
)
15 fuzz_openFile(argv
[2]);
16 } else if (argc
!= 2) {
19 //opens the file, get its size, and reads it into a buffer
20 fp
= fopen(argv
[1], "rb");
24 if (fseek(fp
, 0L, SEEK_END
) != 0) {
29 if (Size
== (size_t) -1) {
33 if (fseek(fp
, 0L, SEEK_SET
) != 0) {
42 if (fread(Data
, Size
, 1, fp
) != 1) {
49 LLVMFuzzerTestOneInput(Data
, Size
);