mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-09 22:30:07 +00:00
Merge pull request #232 from DavidKorczynski/clusterfuzzlite
Add fuzzing by way of ClusterFuzzLite
This commit is contained in:
commit
510419fb6a
6
.clusterfuzzlite/Dockerfile
Normal file
6
.clusterfuzzlite/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM gcr.io/oss-fuzz-base/base-builder
|
||||||
|
RUN apt-get update && apt-get install -y make autoconf automake libtool
|
||||||
|
|
||||||
|
COPY . $SRC/toml11
|
||||||
|
COPY .clusterfuzzlite/build.sh $SRC/build.sh
|
||||||
|
WORKDIR $SRC/toml11
|
3
.clusterfuzzlite/README.md
Normal file
3
.clusterfuzzlite/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# ClusterFuzzLite set up
|
||||||
|
|
||||||
|
This folder contains a fuzzing set for [ClusterFuzzLite](https://google.github.io/clusterfuzzlite).
|
6
.clusterfuzzlite/build.sh
Normal file
6
.clusterfuzzlite/build.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
# Copy fuzzer executable to $OUT/
|
||||||
|
$CXX $CFLAGS $LIB_FUZZING_ENGINE \
|
||||||
|
$SRC/toml11/.clusterfuzzlite/parse_fuzzer.cpp \
|
||||||
|
-o $OUT/parse_fuzzer \
|
||||||
|
-I$SRC/toml11/
|
16
.clusterfuzzlite/parse_fuzzer.cpp
Normal file
16
.clusterfuzzlite/parse_fuzzer.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
#include <toml.hpp>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||||
|
std::string s(reinterpret_cast<const char *>(data), size);
|
||||||
|
std::istringstream iss(s);
|
||||||
|
try {
|
||||||
|
const auto ref = toml::parse(iss);
|
||||||
|
} catch (...) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
1
.clusterfuzzlite/project.yaml
Normal file
1
.clusterfuzzlite/project.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
language: c++
|
30
.github/workflows/cflite_pr.yml
vendored
Normal file
30
.github/workflows/cflite_pr.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: ClusterFuzzLite PR fuzzing
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
permissions: read-all
|
||||||
|
jobs:
|
||||||
|
PR:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
sanitizer: [address]
|
||||||
|
steps:
|
||||||
|
- name: Build Fuzzers (${{ matrix.sanitizer }})
|
||||||
|
id: build
|
||||||
|
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
|
||||||
|
with:
|
||||||
|
sanitizer: ${{ matrix.sanitizer }}
|
||||||
|
language: c++
|
||||||
|
bad-build-check: false
|
||||||
|
- name: Run Fuzzers (${{ matrix.sanitizer }})
|
||||||
|
id: run
|
||||||
|
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
fuzz-seconds: 240
|
||||||
|
mode: 'code-change'
|
||||||
|
report-unreproducible-crashes: false
|
||||||
|
sanitizer: ${{ matrix.sanitizer }}
|
Loading…
Reference in New Issue
Block a user