File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 2727 -DCMAKE_C_COMPILER=clang \
2828 -DCMAKE_CXX_COMPILER=clang++ \
2929 -DHTTP_BUILD_FUZZERS=ON
30- cmake --build build --target request_parser response_parser --parallel
30+ cmake --build build --target request_parser response_parser sha1 --parallel
3131
3232 - name : Extract corpus
3333 run : |
@@ -36,17 +36,20 @@ jobs:
3636 - name : Run fuzzers
3737 run : |
3838 mkdir -p /tmp/corpus
39- LLVM_PROFILE_FILE="request.profraw" ./build/request_parser /tmp/corpus/ seeds/request_parser/ -max_total_time=30
40- LLVM_PROFILE_FILE="response.profraw" ./build/response_parser /tmp/corpus/ seeds/response_parser/ -max_total_time=30
39+ LLVM_PROFILE_FILE="request.profraw" ./build/request_parser /tmp/corpus/ seeds/request_parser/ -max_total_time=30
40+ LLVM_PROFILE_FILE="response.profraw" ./build/response_parser /tmp/corpus/ seeds/response_parser/ -max_total_time=30
41+ LLVM_PROFILE_FILE="sha1.profraw" ./build/sha1 -max_total_time=30
4142
4243 - name : Generate coverage report
4344 run : |
4445 llvm-profdata merge -o coverage.profdata \
4546 request.profraw \
46- response.profraw
47+ response.profraw \
48+ sha1.profraw
4749 llvm-cov export -format=lcov -instr-profile coverage.profdata \
4850 -object ./build/request_parser \
4951 -object ./build/response_parser \
52+ -object ./build/sha1 \
5053 -sources ./src \
5154 > coverage_${{github.sha}}.txt
5255
Original file line number Diff line number Diff line change @@ -75,4 +75,5 @@ if (HTTP_BUILD_FUZZERS)
7575
7676 add_fuzz(request_parser fuzz/request_parser.cpp)
7777 add_fuzz(response_parser fuzz/response_parser.cpp)
78+ add_fuzz(sha1 fuzz/sha1.cpp)
7879endif ()
Original file line number Diff line number Diff line change 1+ #include < cstdint>
2+ #include < cstddef>
3+ #include < http.h>
4+
5+ extern " C" int LLVMFuzzerTestOneInput (const uint8_t * data, size_t size)
6+ {
7+ auto sum = http::sha1{}.push (size, data).finish ();
8+ return 0 ;
9+ }
You can’t perform that action at this time.
0 commit comments