-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a fuzzer for more of the terminal pipeline, adding coverage for the input and output portions of the terminal framebuffer.
- Loading branch information
Showing
18 changed files
with
33 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) $(FUZZING_CFLAGS) | ||
|
||
noinst_PROGRAMS = terminal_parser_fuzzer | ||
noinst_PROGRAMS = terminal_parser_fuzzer terminal_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 | ||
|
||
terminal_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util -I$(srcdir)/../statesync -I../protobufs | ||
terminal_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a ../statesync/libmoshstatesync.a ../protobufs/libmoshprotos.a $(TINFO_LIBS) $(protobuf_LIBS) | ||
terminal_fuzzer_SOURCES = terminal_fuzzer.cc |
Binary file not shown.
1 change: 1 addition & 0 deletions
1
src/fuzz/terminal_corpus/3a52ce780950d4d969792a2559cd519d7ee8c727
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 @@ | ||
. |
Binary file not shown.
1 change: 1 addition & 0 deletions
1
src/fuzz/terminal_corpus/433f367f36f48f78570c2013fef7a4f4b52b7c0c
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 @@ | ||
&�����:# |
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
src/fuzz/terminal_corpus/7c4d33785daa5c2370201ffa236b427aa37c9996
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 @@ | ||
& |
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
src/fuzz/terminal_corpus/9a78211436f6d425ec38f5c4e02270801f3524f8
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 @@ | ||
@ |
3 changes: 3 additions & 0 deletions
3
src/fuzz/terminal_corpus/a70a7fcfa8e88039504b6a798314285419f51e16
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,3 @@ | ||
|
||
|
||
@ |
1 change: 1 addition & 0 deletions
1
src/fuzz/terminal_corpus/adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
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 @@ | ||
|
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
src/fuzz/terminal_corpus/e0d3c08cb28736844512c52dc05fa4e4efd91490
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,2 @@ | ||
|
||
@ |
1 change: 1 addition & 0 deletions
1
src/fuzz/terminal_corpus/f195c020a28dfc5f2fb6af256b524ddcd93756ed
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 @@ | ||
� |
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,17 @@ | ||
#include <cstddef> | ||
#include <cstdint> | ||
|
||
#include "parser.h" | ||
#include "completeterminal.h" | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | ||
Terminal::Display display(false); | ||
Terminal::Complete complete(80, 24); | ||
Terminal::Framebuffer state(80, 24); | ||
for (size_t i = 0; i < size; i++) { | ||
complete.act(Parser::UserByte(data[i])); | ||
} | ||
display.new_frame(true, state, complete.get_fb()); | ||
|
||
return 0; | ||
} |