-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove some code never triggered AFP: the removed check is included in the following one MQTT: fix flags extraction
- Loading branch information
Showing
18 changed files
with
99 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
#include <stdint.h> | ||
#include "shoco.h" | ||
#include "ndpi_api.h" | ||
#include "fuzzer/FuzzedDataProvider.h" | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | ||
FuzzedDataProvider fuzzed_data(data, size); | ||
const char *in; | ||
size_t in_len, out_len; | ||
char out[8192], orig[8192]; | ||
int higher_level_api; | ||
|
||
/* No memory allocations involved */ | ||
|
||
higher_level_api = fuzzed_data.ConsumeBool(); | ||
|
||
std::string s = fuzzed_data.ConsumeRemainingBytesAsString().c_str(); | ||
in = s.c_str(); | ||
in_len = strlen(in); | ||
|
||
out_len = shoco_compress(in, in_len, out, sizeof(out)); | ||
if(out_len <= sizeof(out)) /* No error */ | ||
shoco_decompress(out, out_len, orig, sizeof(orig)); | ||
if(!higher_level_api) { | ||
out_len = shoco_compress(in, in_len, out, sizeof(out)); | ||
if(out_len <= sizeof(out)) /* No error */ | ||
shoco_decompress(out, out_len, orig, sizeof(orig)); | ||
} else { | ||
out_len = ndpi_compress_str(in, in_len, out, sizeof(out)); | ||
if(out_len != 0) /* No error */ | ||
ndpi_decompress_str(out, out_len, orig, sizeof(orig)); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Oops, something went wrong.