diff options
author | Eugene Kliuchnikov <eustas.ru@gmail.com> | 2020-07-29 01:06:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 16:06:51 -0700 |
commit | 3c234c8f1c2319f27a328656c84c7eaf7767a561 (patch) | |
tree | 89b16d4d2eddf92684e31072e4e4da9ad17ed481 /projects/brunsli | |
parent | 56a3b89eae1a86cbc269fb0b14d4a45325e4d7c2 (diff) |
Add fuzzer for Brunsli decoder (#4205)
Diffstat (limited to 'projects/brunsli')
-rw-r--r-- | projects/brunsli/Dockerfile | 24 | ||||
-rwxr-xr-x | projects/brunsli/build.sh | 34 | ||||
-rw-r--r-- | projects/brunsli/project.yaml | 17 |
3 files changed, 75 insertions, 0 deletions
diff --git a/projects/brunsli/Dockerfile b/projects/brunsli/Dockerfile new file mode 100644 index 00000000..24dc994f --- /dev/null +++ b/projects/brunsli/Dockerfile @@ -0,0 +1,24 @@ +# Copyright 2020 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder +RUN apt-get update && apt-get install -y cmake libtool make + +RUN git clone --depth 1 https://github.com/google/brunsli.git && \ + cd brunsli && \ + git submodule update --init --depth 1 +WORKDIR brunsli +COPY build.sh $SRC/ diff --git a/projects/brunsli/build.sh b/projects/brunsli/build.sh new file mode 100755 index 00000000..adf4cf28 --- /dev/null +++ b/projects/brunsli/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash -eu +# Copyright 2020 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +cmake . -DBUILD_TESTING=OFF +make clean +make -j$(nproc) brunslidec-static + +# TODO(eustas): add seed corpus + +$CXX $CXXFLAGS -std=c++11 -I./c/include c/tests/fuzz_decode.cc \ + -o $OUT/fuzz_decode $LIB_FUZZING_ENGINE \ + ./libbrunslidec-static.a ./libbrunslicommon-static.a \ + ./third_party/brotli/libbrotlidec-static.a \ + ./third_party/brotli/libbrotlicommon-static.a + +$CXX $CXXFLAGS -std=c++11 -I./c/include c/tests/fuzz_decode_streaming.cc \ + -o $OUT/fuzz_decode_streaming $LIB_FUZZING_ENGINE \ + ./libbrunslidec-static.a ./libbrunslicommon-static.a \ + ./third_party/brotli/libbrotlidec-static.a \ + ./third_party/brotli/libbrotlicommon-static.a diff --git a/projects/brunsli/project.yaml b/projects/brunsli/project.yaml new file mode 100644 index 00000000..7eb3aebf --- /dev/null +++ b/projects/brunsli/project.yaml @@ -0,0 +1,17 @@ +homepage: "https://github.com/google/brunsli" +language: c++ +primary_contact: "eustas@chromium.org" +vendor_ccs: + - "jkew@mozilla.com" + - "twsmith@mozilla.com" +fuzzing_engines: + - libfuzzer + - afl + - honggfuzz +sanitizers: + - address + - memory + - undefined +architectures: + - x86_64 + - i386 |