[fribidi] Add fribidi-fuzzer (#5829)

This commit is contained in:
ebraminio 2021-05-25 19:06:03 +04:30 committed by GitHub
parent 4279eb7844
commit 693dd5037f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# Copyright 2021 Google LLC
#
# 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 python3-pip pkg-config && \
pip3 install meson==0.53.0 ninja
RUN git clone --depth 1 https://github.com/fribidi/fribidi.git
WORKDIR fribidi
COPY build.sh $SRC/

36
projects/fribidi/build.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash -eu
# Copyright 2021 Google LLC
#
# 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.
#
################################################################################
# setup
build=$WORK/build
# cleanup
rm -rf $build
mkdir -p $build
# Build the library.
meson --default-library=static --wrap-mode=nodownload -Ddocs=false \
-Dfuzzer_ldflags="$(echo $LIB_FUZZING_ENGINE)" \
$build \
|| (cat build/meson-logs/meson-log.txt && false)
# Build the fuzzers.
ninja -v -j$(nproc) -C $build bin/fribidi-fuzzer
mv $build/bin/fribidi-fuzzer $OUT/
# Archive and copy to $OUT seed corpus if the build succeeded.
zip $OUT/fribidi-fuzzer_seed_corpus.zip test/*.{input,reference} test/fuzzing/*

View File

@ -0,0 +1,17 @@
homepage: "https://github.com/fribidi/fribidi"
language: c
primary_contact: "dov.grobgeld@gmail.com"
auto_ccs:
- "behdad.esfahbod@gmail.com"
- "behdad@gnu.org"
- "ebrahim@gnu.org"
- "dr.khaled.hosny@gmail.com"
fuzzing_engines:
- libfuzzer
- afl
- honggfuzz
sanitizers:
- address
- undefined
- memory
main_repo: 'https://github.com/fribidi/fribidi.git'