File tree Expand file tree Collapse file tree 10 files changed +34
-3
lines changed Expand file tree Collapse file tree 10 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 11* .o
2- /color
2+ /test
3+ /fuzz
4+ /output
Original file line number Diff line number Diff line change 1- CXXFLAGS = -std=c++11 -Wall -Wextra -Wpedantic -Weverything -Wno-c++98-compat -Wno-missing-prototypes -Wno-padded - Wno-unused-parameter
1+ CXXFLAGS = -std=c++11 -Wall -Wextra -Wpedantic -Wno-unused-parameter
22
33build : test
44
55test : csscolorparser.o test.o
66$(CXX ) $(CXXFLAGS ) -o $@ $^
77
8+ fuzz : csscolorparser.o fuzz.o
9+ afl-clang-fast++ $(CXXFLAGS ) -o $@ $^
10+
11+ fuzz.o : fuzz.cpp
12+ afl-clang-fast++ $(CXXFLAGS ) -c -o $@ $^
13+
814% .o : % .cpp
915$(CXX ) $(CXXFLAGS ) -c -o $@ $^
1016
1117clean :
12- rm -rf * .o test
18+ rm -rf * .o test fuzz
1319
1420.PHONY : clean
Original file line number Diff line number Diff line change 1+ #include " csscolorparser.hpp"
2+
3+ #include < iostream>
4+ #include < istream>
5+
6+ int main (int argc, char * argv[]) {
7+ while (__AFL_LOOP (1000 )) {
8+ // Pass stdin to the function.
9+ std::cin >> std::noskipws;
10+ CSSColorParser::parse ({ std::istream_iterator<char >(std::cin), std::istream_iterator<char >() });
11+ }
12+ return 0 ;
13+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
2+
3+ make fuzz
4+ afl-fuzz -i input -o output -- ./fuzz
Original file line number Diff line number Diff line change 1+ rgba(255, 128, 12, 0.5)
Original file line number Diff line number Diff line change 1+ #fff
Original file line number Diff line number Diff line change 1+ #ff0011
Original file line number Diff line number Diff line change 1+ slateblue
Original file line number Diff line number Diff line change 1+ ffffff
Original file line number Diff line number Diff line change 1+ hsla(900, 15%, 90%, 0.5)
You can’t perform that action at this time.
0 commit comments