From c2f20c589313bc12d42fba4fa3b5160ff95a48a8 Mon Sep 17 00:00:00 2001 From: Cody Oss Date: Thu, 24 Sep 2020 16:11:46 -0600 Subject: [PATCH] [google-cloud-go] Initial integration --- projects/google-cloud-go/Dockerfile | 21 ++++++++++++++++++++ projects/google-cloud-go/build.sh | 28 +++++++++++++++++++++++++++ projects/google-cloud-go/project.yaml | 7 +++++++ 3 files changed, 56 insertions(+) create mode 100644 projects/google-cloud-go/Dockerfile create mode 100644 projects/google-cloud-go/build.sh create mode 100644 projects/google-cloud-go/project.yaml diff --git a/projects/google-cloud-go/Dockerfile b/projects/google-cloud-go/Dockerfile new file mode 100644 index 000000000000..1d2b38e5304a --- /dev/null +++ b/projects/google-cloud-go/Dockerfile @@ -0,0 +1,21 @@ +# 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 +LABEL maintainer="codyoss@google.com" +RUN go get cloud.google.com/go/spanner +COPY build.sh $SRC/ +WORKDIR $SRC/ diff --git a/projects/google-cloud-go/build.sh b/projects/google-cloud-go/build.sh new file mode 100644 index 000000000000..38db5cb909b4 --- /dev/null +++ b/projects/google-cloud-go/build.sh @@ -0,0 +1,28 @@ +#!/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. +# +################################################################################ + +function compile_fuzzer() { + path=$1 + function=$2 + fuzzer=$3 + + go-fuzz -func $function -o $fuzzer.a $path + + $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer +} + +compile_fuzzer cloud.google.com/go/spanner/spansql FuzzParseQuery fuzz_parse_query diff --git a/projects/google-cloud-go/project.yaml b/projects/google-cloud-go/project.yaml new file mode 100644 index 000000000000..f336624e05c9 --- /dev/null +++ b/projects/google-cloud-go/project.yaml @@ -0,0 +1,7 @@ +homepage: "https://github.com/googleapis/google-cloud-go" +primary_contact: "codyoss@google.com" +language: go +fuzzing_engines: + - libfuzzer +sanitizers: + - address