mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
fix: issue found by fuzzing (#846)
* Add the beginnings of a fuzzing system for CLI11. This commit adds the fuzzing code, a simple test, and two fixes to issues(seg faults) found by the initial round of fuzzing. It also adds a few tests and coverage issues uncovered in the process of developing the fuzz tests. As a side effect adjusts some of the azure tests to specify the vmImage which was being changed on azure. * update license to match rest of code base --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
2
.github/codecov.yml
vendored
2
.github/codecov.yml
vendored
@@ -1,6 +1,6 @@
|
||||
codecov:
|
||||
notify:
|
||||
after_n_builds: 4
|
||||
after_n_builds: 8
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
|
||||
54
.github/workflows/fuzz.yml
vendored
Normal file
54
.github/workflows/fuzz.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Fuzz
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v*
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
quick_fuzz1:
|
||||
name: quickfuzz1
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake -S . -B build \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DCLI11_SINGLE_FILE_TESTS=OFF \
|
||||
-DCLI11_BUILD_EXAMPLES=OFF \
|
||||
-DCLI11_FUZZ_TARGET=ON \
|
||||
-DCLI11_BUILD_TESTS=OFF \
|
||||
-DCLI11_BUILD_DOCS=OFF \
|
||||
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_COMPILER_FORCED=ON \
|
||||
-DCMAKE_CXX_FLAGS="-g -O1 -fsanitize=fuzzer,undefined,address"
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build -j4
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd build
|
||||
make QUICK_CLI11_APP_FUZZ
|
||||
|
||||
- name: Test2
|
||||
run: |
|
||||
cd build
|
||||
make QUICK_CLI11_FILE_FUZZ
|
||||
|
||||
|
||||
- name: artifacts
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: file_failure
|
||||
path: ./build/fuzz/cli11_*_fail_artifact.txt
|
||||
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -48,7 +48,7 @@ jobs:
|
||||
- name: Prepare coverage
|
||||
run: |
|
||||
lcov --directory . --capture --output-file coverage.info
|
||||
lcov --remove coverage.info '*/tests/*' '*/examples/*' '/usr/*' '*/book/*' --output-file coverage.info
|
||||
lcov --remove coverage.info '*/tests/*' '*/examples/*' '/usr/*' '*/book/*' '*/fuzz/*' --output-file coverage.info
|
||||
lcov --list coverage.info
|
||||
working-directory: build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user