From 693dd5037f6740093e1d4260ad3ef960df9732b6 Mon Sep 17 00:00:00 2001 From: ebraminio Date: Tue, 25 May 2021 19:06:03 +0430 Subject: [PATCH] [fribidi] Add fribidi-fuzzer (#5829) --- projects/fribidi/Dockerfile | 22 +++++++++++++++++++++ projects/fribidi/build.sh | 36 +++++++++++++++++++++++++++++++++++ projects/fribidi/project.yaml | 17 +++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 projects/fribidi/Dockerfile create mode 100755 projects/fribidi/build.sh create mode 100644 projects/fribidi/project.yaml diff --git a/projects/fribidi/Dockerfile b/projects/fribidi/Dockerfile new file mode 100644 index 000000000..b4d9ea75d --- /dev/null +++ b/projects/fribidi/Dockerfile @@ -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/ diff --git a/projects/fribidi/build.sh b/projects/fribidi/build.sh new file mode 100755 index 000000000..aa8f60acc --- /dev/null +++ b/projects/fribidi/build.sh @@ -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/* diff --git a/projects/fribidi/project.yaml b/projects/fribidi/project.yaml new file mode 100644 index 000000000..7fbac3aa0 --- /dev/null +++ b/projects/fribidi/project.yaml @@ -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'