-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David Korczynski <david@adalogics.com>
- Loading branch information
1 parent
6587ed2
commit 0cb865a
Showing
2 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Numaqtl fuzzing | ||
|
||
OSS-Fuzz fuzzing suite. Fuzzers here are meant to run by way of OSS-Fuzz and | ||
will be build and executed continuously. |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include "numa.h" | ||
|
||
|
||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | ||
struct bitmask *mask = NULL; | ||
|
||
char *fuzz_str1 = malloc(size+1); | ||
memcpy(fuzz_str1, data, size); | ||
fuzz_str1[size] = '\0'; | ||
|
||
mask = numa_parse_nodestring(fuzz_str1); | ||
if (mask != NULL) { | ||
numa_bitmask_free(mask); | ||
} | ||
|
||
// NULLify the mask variable before we use it again. | ||
mask = NULL; | ||
mask = numa_parse_cpustring(fuzz_str1); | ||
if (mask != NULL) { | ||
numa_node_to_cpus_v2(0, mask); | ||
numa_bitmask_free(mask); | ||
} | ||
|
||
free(fuzz_str1); | ||
return 0; | ||
} |