From 03de1c66f0dcd4cf4a82a4b8652c844dcc3c9bba Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Thu, 21 Jan 2021 11:54:46 +0000 Subject: httplib2: initial integration. (#5000) --- projects/httplib2/Dockerfile | 22 ++++++++++++++++++++++ projects/httplib2/build.sh | 35 +++++++++++++++++++++++++++++++++++ projects/httplib2/project.yaml | 11 +++++++++++ 3 files changed, 68 insertions(+) create mode 100644 projects/httplib2/Dockerfile create mode 100644 projects/httplib2/build.sh create mode 100644 projects/httplib2/project.yaml (limited to 'projects/httplib2') diff --git a/projects/httplib2/Dockerfile b/projects/httplib2/Dockerfile new file mode 100644 index 00000000..f7dcaf21 --- /dev/null +++ b/projects/httplib2/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 git clone --depth 1 https://github.com/httplib2/httplib2 + +COPY build.sh $SRC/ + +WORKDIR $SRC/httplib2 diff --git a/projects/httplib2/build.sh b/projects/httplib2/build.sh new file mode 100644 index 00000000..3a3d0eae --- /dev/null +++ b/projects/httplib2/build.sh @@ -0,0 +1,35 @@ +#!/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. +# +################################################################################ + +pip3 install six +python3 setup.py install + +# Build fuzzers in $OUT. +for fuzzer in $(find ./tests/ -name 'fuzz_*.py'); do + fuzzer_basename=$(basename -s .py $fuzzer) + fuzzer_package=${fuzzer_basename}.pkg + pyinstaller --distpath $OUT --onefile --name $fuzzer_package $fuzzer + + # Create execution wrapper. + echo "#!/bin/sh +# LLVMFuzzerTestOneInput for fuzzer detection. +this_dir=\$(dirname \"\$0\") +LD_PRELOAD=\$this_dir/sanitizer_with_fuzzer.so \ +ASAN_OPTIONS=\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\$this_dir/llvm-symbolizer:detect_leaks=0 \ +\$this_dir/$fuzzer_package \$@" > $OUT/$fuzzer_basename + chmod u+x $OUT/$fuzzer_basename +done diff --git a/projects/httplib2/project.yaml b/projects/httplib2/project.yaml new file mode 100644 index 00000000..210aa12a --- /dev/null +++ b/projects/httplib2/project.yaml @@ -0,0 +1,11 @@ +homepage: "https://github.com/httplib2/httplib2" +language: python +primary_contact: "temotor@gmail.com" +auto_ccs: + - "david@adalogics.com" +fuzzing_engines: + - libfuzzer +sanitizers: + - address + - undefined +main_repo: "https://github.com/httplib2/httplib2" -- cgit v1.2.3