mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-09 14:20:06 +00:00
ci: add fuzzer workflow
Squashed commit of the following:
commit b13ab5d298da1472e27254b801e21b26fe8c5e3f
Merge: 2feb35e 26212f3
Author: ToruNiina <niina.toru.68u@gmail.com>
Date: Mon Jun 17 00:08:04 2024 +0900
[skip appveyor] Merge branch 'main' into fuzzing
commit 2feb35e83e3f2f9b68f5e2074c9ddbce9a8b0ebc
Author: ToruNiina <niina.toru.68u@gmail.com>
Date: Mon Jun 17 00:07:34 2024 +0900
fix: call destructor correctly
commit c6078b5afec054bd7f488c4de8cbbd719fa89d3b
Author: ToruNiina <niina.toru.68u@gmail.com>
Date: Mon Jun 17 00:07:12 2024 +0900
feat: add SFINAE to template ctor of result
commit 850ea75bae7c7f54bde653cd99c066240bd95674
Author: ToruNiina <niina.toru.68u@gmail.com>
Date: Sun Jun 16 22:16:17 2024 +0900
fix: path to fuzzer impl
commit e91edeae96b48b243b97c96f36ca027cace6925b
Author: ToruNiina <niina.toru.68u@gmail.com>
Date: Sun Jun 16 22:10:07 2024 +0900
ci[skip appveyor]: move fuzzing dir to default dir
commit 3bd51f2047936e9abb6dd47e627379b04d711d2b
Author: ToruNiina <niina.toru.68u@gmail.com>
Date: Sun Jun 16 21:46:56 2024 +0900
ci[skip appveyor]: temporary remove other workflows
until fuzzer works
commit 847a76e089e12302557ba7ffd699d2b26e3e954a
Author: ToruNiina <niina.toru.68u@gmail.com>
Date: Sun Jun 16 21:46:02 2024 +0900
ci[skip appveyor]: add fuzzer workflow
This commit is contained in:
parent
26212f3536
commit
f317cc0448
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/include/
|
10
.clusterfuzzlite/parse_fuzzer.cpp
Normal file
10
.clusterfuzzlite/parse_fuzzer.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include <toml.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
{
|
||||
std::string s(reinterpret_cast<const char *>(data), size);
|
||||
const auto ref = toml::try_parse_str(s);
|
||||
return 0;
|
||||
}
|
1
.clusterfuzzlite/project.yaml
Normal file
1
.clusterfuzzlite/project.yaml
Normal file
@ -0,0 +1 @@
|
||||
language: c++
|
30
.github/workflows/fuzzing.yml
vendored
Normal file
30
.github/workflows/fuzzing.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: ClusterFuzzLite fuzzing
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
fuzzing:
|
||||
runs-on: ubuntu-22.04
|
||||
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