Add GNU wget2 to oss-fuzz (#630)

This commit is contained in:
Tim Rühsen 2017-05-29 17:34:31 +02:00 committed by Abhishek Arya
parent 9eab6b6469
commit 3d1773b3d4
3 changed files with 89 additions and 0 deletions

42
projects/wget2/Dockerfile Normal file
View File

@ -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/

43
projects/wget2/build.sh Executable file
View File

@ -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

View File

@ -0,0 +1,4 @@
homepage: "https://gitlab.com/gnuwget/wget2"
primary_contact: "rockdaboot@gmail.com"
auto_ccs:
- "tim.ruehsen@gmx.de"