mirror of https://github.com/google/oss-fuzz.git
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:
parent
1e8faea74e
commit
b35f790d0d
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||
}
|
|
@ -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
|
Loading…
Reference in New Issue