go-toml: initial integration (#8368)

* go-toml: initial integration

* Added primary_contact

* Updated repo to use v2 branch

* Removed check against too large testcase
This commit is contained in:
manunio 2022-08-29 19:49:32 +05:30 committed by GitHub
parent 1e8faea74e
commit b35f790d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# 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-go
RUN apt-get update && apt-get install -y make autoconf automake libtool vim
RUN git clone --depth 1 --single-branch --branch v2 https://github.com/pelletier/go-toml go-toml
COPY build.sh $SRC/
COPY *.go $SRC/go-toml
WORKDIR $SRC/go-toml

18
projects/go-toml/build.sh Executable file
View File

@ -0,0 +1,18 @@
#!/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.
#
################################################################################
compile_go_fuzzer . FuzzToml fuzz_toml gofuzz

16
projects/go-toml/fuzz.go Normal file
View File

@ -0,0 +1,16 @@
package toml
func FuzzToml(data []byte) int {
var v interface{}
err := Unmarshal(data, &v)
if err != nil {
return 0
}
_, err = Marshal(v)
if err != nil {
return 0
}
return 1
}

View File

@ -0,0 +1,10 @@
homepage: "https://github.com/pelletier/go-toml"
language: go
main_repo: "https://github.com/pelletier/go-toml"
primary_contact: "pelletier.thomas@gmail.com"
fuzzing_engines:
- libfuzzer
sanitizers:
- address
vendor_ccs:
- maxnair.dev@gmail.com