diff --git a/projects/python-phonenumbers/Dockerfile b/projects/python-phonenumbers/Dockerfile new file mode 100644 index 000000000..fda4cc4ad --- /dev/null +++ b/projects/python-phonenumbers/Dockerfile @@ -0,0 +1,27 @@ +# Copyright 2022 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-python + +RUN apt-get update && apt-get install -y make autoconf automake libtool +RUN git clone --depth 1 https://github.com/daviddrysdale/python-phonenumbers.git python-phonenumbers +RUN git clone --depth 1 https://github.com/rikfie/python-phonenumbers-fuzzer.git ppf && \ + mv ppf/*_fuzzer.py $SRC/ && \ + rm -rf ppf + +WORKDIR python-phonenumbers/python + +COPY build.sh $SRC/ \ No newline at end of file diff --git a/projects/python-phonenumbers/build.sh b/projects/python-phonenumbers/build.sh new file mode 100755 index 000000000..593e9d1e1 --- /dev/null +++ b/projects/python-phonenumbers/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash -eu +# Copyright 2022 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 --upgrade pip +pip3 install . + +# Build fuzzers in $OUT. +for fuzzer in $(find $SRC -name '*_fuzzer.py'); do + compile_python_fuzzer $fuzzer +done diff --git a/projects/python-phonenumbers/project.yaml b/projects/python-phonenumbers/project.yaml new file mode 100644 index 000000000..7c590f4a9 --- /dev/null +++ b/projects/python-phonenumbers/project.yaml @@ -0,0 +1,11 @@ +homepage: "https://github.com/daviddrysdale/python-phonenumbers" +language: python +primary_contact: "rik@purpleguy.nl" +auto_ccs: + - "drysdale@google.com" +main_repo: "https://github.com/daviddrysdale/python-phonenumbers.git" +fuzzing_engines: + - libfuzzer +sanitizers: + - address + - undefined