diff --git a/projects/libregf/Dockerfile b/projects/libregf/Dockerfile new file mode 100644 index 000000000..ca2168c14 --- /dev/null +++ b/projects/libregf/Dockerfile @@ -0,0 +1,23 @@ +# 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 make autoconf automake autopoint libtool pkg-config + +RUN git clone --depth 1 https://github.com/libyal/libregf.git libregf +WORKDIR libregf +COPY build.sh $SRC/ diff --git a/projects/libregf/build.sh b/projects/libregf/build.sh new file mode 100755 index 000000000..07ce84e16 --- /dev/null +++ b/projects/libregf/build.sh @@ -0,0 +1,29 @@ +#!/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. +# +################################################################################ + +# Prepare the project source for build. +./synclibs.sh +./synctestdata.sh +./autogen.sh +./configure --enable-shared=no + +# Build the project and fuzzer binaries. +make -j$(nproc) LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE} + +# Copy the fuzzer binaries and test data to the output directory. +find ossfuzz -executable -type f -exec cp {} ${OUT} \; +(cd tests/input/public/ && zip ${OUT}/file_fuzzer_seed_corpus.zip *) diff --git a/projects/libregf/project.yaml b/projects/libregf/project.yaml new file mode 100644 index 000000000..7aa1e7152 --- /dev/null +++ b/projects/libregf/project.yaml @@ -0,0 +1,10 @@ +homepage: "https://github.com/libyal/libregf" +language: c +primary_contact: "joachim.metz@gmail.com" +sanitizers: +- address +- memory +- undefined +architectures: +- x86_64 +- i386