Add fuzzing infrastructure
This commit adds the --enable-fuzzing (and --enable-asan, to make fuzzing more useful) options and a sample fuzzer for the terminal parser. At this time only libfuzzer is supported. Future changes to add AFL to get more fuzzing capability should be possible with the addition of the afl_driver.cc from Chromium.
This commit is contained in:
committed by
Alex Chernyakhovsky
parent
1f27c532ac
commit
0c6e034459
@@ -0,0 +1,7 @@
|
||||
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) $(FUZZING_CFLAGS)
|
||||
|
||||
noinst_PROGRAMS = terminal_parser_fuzzer
|
||||
|
||||
terminal_parser_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util
|
||||
terminal_parser_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a
|
||||
terminal_parser_fuzzer_SOURCES = terminal_parser_fuzzer.cc
|
||||
@@ -0,0 +1,2 @@
|
||||
�
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
|
||||
��������
|
||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
|
||||
����
|
||||
@@ -0,0 +1,15 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
Parser::UTF8Parser parser;
|
||||
Parser::Actions result;
|
||||
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
parser.input(data[i], result);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user