-
-
Notifications
You must be signed in to change notification settings - Fork 495
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: Arjun Singh <[email protected]>
- Loading branch information
Showing
5 changed files
with
50 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
CC=clang | ||
CXX=clang++ | ||
LIB_FUZZING_ENGINE="-fsanitize=fuzzer" | ||
|
||
# Compile and link with AddressSanitizer | ||
CFLAGS_ASAN="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link" | ||
$CC $CFLAGS_ASAN -c ../ini.c | ||
$CC $CFLAGS_ASAN -c inihfuzz.c | ||
$CXX $CFLAGS_ASAN $LIB_FUZZING_ENGINE inihfuzz.o ini.o -o inihfuzz_asan | ||
rm *.o | ||
|
||
# Compile and link with MemorySanitizer | ||
CFLAGS_MSAN="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize-memory-track-origins -fsanitize=fuzzer-no-link" | ||
$CC $CFLAGS_MSAN -c ../ini.c | ||
$CC $CFLAGS_MSAN -c inihfuzz.c | ||
$CXX $CFLAGS_MSAN $LIB_FUZZING_ENGINE inihfuzz.o ini.o -o inihfuzz_msan | ||
rm *.o | ||
|
||
# Compile and link with UndefinedBehaviorSanitizer | ||
CFLAGS_UBSAN="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr -fsanitize=fuzzer-no-link" | ||
$CC $CFLAGS_UBSAN -c ../ini.c | ||
$CC $CFLAGS_UBSAN -c inihfuzz.c | ||
$CXX $CFLAGS_UBSAN $LIB_FUZZING_ENGINE inihfuzz.o ini.o -o inihfuzz_ubsan | ||
rm *.o | ||
|
||
# Uncomment to run the fuzzer of your choice | ||
#cp -r testcases/ testcases_seed | ||
#./inihfuzz_asan testcases_seed | ||
#./inihfuzz_msan testcases_seed | ||
#./inihfuzz_ubsan testcases_seed |
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