From 3d1773b3d470e711f13e03e13a37c8e2269af1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 29 May 2017 17:34:31 +0200 Subject: [PATCH] Add GNU wget2 to oss-fuzz (#630) --- projects/wget2/Dockerfile | 42 ++++++++++++++++++++++++++++++++++++ projects/wget2/build.sh | 43 +++++++++++++++++++++++++++++++++++++ projects/wget2/project.yaml | 4 ++++ 3 files changed, 89 insertions(+) create mode 100644 projects/wget2/Dockerfile create mode 100755 projects/wget2/build.sh create mode 100644 projects/wget2/project.yaml diff --git a/projects/wget2/Dockerfile b/projects/wget2/Dockerfile new file mode 100644 index 000000000..518fc6987 --- /dev/null +++ b/projects/wget2/Dockerfile @@ -0,0 +1,42 @@ +# Copyright 2016 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 +MAINTAINER rockdaboot@gmail.com +RUN apt-get update && apt-get install -y \ + pkg-config \ + gettext \ + autopoint \ + autoconf \ + automake \ + libtool \ + texinfo \ + flex \ + liblzma-dev \ + libidn2-0-dev \ + libunistring-dev \ + zlib1g-dev \ + libbz2-dev \ + gnutls-dev \ + libpsl-dev \ + libnghttp2-dev \ + doxygen + +RUN git clone --depth=1 https://gitlab.com/gnuwget/wget2.git +RUN cd wget2 && git submodule update --init + +WORKDIR wget2 +COPY build.sh $SRC/ diff --git a/projects/wget2/build.sh b/projects/wget2/build.sh new file mode 100755 index 000000000..88749d729 --- /dev/null +++ b/projects/wget2/build.sh @@ -0,0 +1,43 @@ +#!/bin/bash -eu +# Copyright 2016 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. +# +################################################################################ + +./bootstrap +./configure --enable-static --disable-doc +make + +cp -p fuzz/*.dict fuzz/*.options $OUT + +fuzzers=$(find fuzz/ -name "*_fuzzer.cc") + +for f in $fuzzers; do + fuzzer=$(basename "$f" ".cc") + + $CXX $CXXFLAGS -std=c++11 -Iinclude/wget/ \ + "fuzz/${fuzzer}.cc" -o "$OUT/${fuzzer}" \ + libwget/.libs/libwget.a -lFuzzingEngine -Wl,-Bstatic \ + -lidn2 -lunistring \ + -Wl,-Bdynamic + + if [ -f "$SRC/${fuzzer}_seed_corpus.zip" ]; then + cp "$SRC/${fuzzer}_seed_corpus.zip" "$OUT/" + fi + + corpus_dir=$(basename "${fuzzer}" "_fuzzer") + if [ -d "fuzz/${corpus_dir}.in/" ]; then + zip -r "$OUT/${fuzzer}_seed_corpus.zip" "fuzz/${corpus_dir}.in/" + fi +done diff --git a/projects/wget2/project.yaml b/projects/wget2/project.yaml new file mode 100644 index 000000000..99ca0648a --- /dev/null +++ b/projects/wget2/project.yaml @@ -0,0 +1,4 @@ +homepage: "https://gitlab.com/gnuwget/wget2" +primary_contact: "rockdaboot@gmail.com" +auto_ccs: + - "tim.ruehsen@gmx.de"