From a24dac5135c6598a09386c27297e2e0d47349e82 Mon Sep 17 00:00:00 2001 From: Omkar Jadhav Date: Thu, 15 Oct 2020 20:07:17 +0530 Subject: [PATCH] [yhirose/cpp-httplib] Add to oss-fuzz (#4508) * Add cpp-httplib to oss-fuzz * change primary contact in project.yaml * Remove fuzzing_engines property from project.yaml * Incorporate new changes in httplib.h * Disable i386 config * Remove memory sanitizer * Fix formatting issues * 1. Use official repo 2. Add new email to autocc --- projects/cpp-httplib/Dockerfile | 34 +++++++++++++++++++++++++++++++ projects/cpp-httplib/build.sh | 24 ++++++++++++++++++++++ projects/cpp-httplib/project.yaml | 9 ++++++++ 3 files changed, 67 insertions(+) create mode 100644 projects/cpp-httplib/Dockerfile create mode 100755 projects/cpp-httplib/build.sh create mode 100644 projects/cpp-httplib/project.yaml diff --git a/projects/cpp-httplib/Dockerfile b/projects/cpp-httplib/Dockerfile new file mode 100644 index 000000000..622073808 --- /dev/null +++ b/projects/cpp-httplib/Dockerfile @@ -0,0 +1,34 @@ +# 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 libtool + +# Install brotli. +RUN apt-get install -y libbrotli-dev + +# Install zlib. +RUN apt-get update && apt-get install -y zlib1g-dev + +# Install openssl 1.1.1 +RUN curl -o openssl-1.1.1f.tar.gz https://www.openssl.org/source/openssl-1.1.1f.tar.gz && \ + tar xzvf openssl-1.1.1f.tar.gz +RUN cd openssl-1.1.1f && ./config && make && make install_sw + +RUN git clone --depth 1 https://github.com/yhirose/cpp-httplib.git cpp-httplib + +WORKDIR cpp-httplib +COPY build.sh $SRC/ diff --git a/projects/cpp-httplib/build.sh b/projects/cpp-httplib/build.sh new file mode 100755 index 000000000..0cdbd809d --- /dev/null +++ b/projects/cpp-httplib/build.sh @@ -0,0 +1,24 @@ +#!/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. +# +################################################################################ + +# Build fuzz targets specified in test/Makefile. +cd test/fuzzing && make -j$(nproc) server_fuzzer + +# Copy the fuzzer executables, zip-ed corpora, option and dictionary files to $OUT. +find . -name '*_fuzzer' -exec cp -v '{}' $OUT ';' # Copy fuzz-target. +find . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';' # Copy dictionaries. +find . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';' # Copy seed corpora. diff --git a/projects/cpp-httplib/project.yaml b/projects/cpp-httplib/project.yaml new file mode 100644 index 000000000..d8f236e11 --- /dev/null +++ b/projects/cpp-httplib/project.yaml @@ -0,0 +1,9 @@ +homepage: "https://github.com/yhirose/cpp-httplib" +language: c++ +primary_contact: "yuji.hirose.bug@gmail.com" +auto_ccs : + - "cpp-httplib-oss-fuzz@googlegroups.com" +sanitizers: + - address + - dataflow + - undefined