mirror of https://github.com/google/oss-fuzz.git
json5format initial integration (#5354)
* json5format initial integration * Updated the dockerfile for json5format.
This commit is contained in:
parent
d108b02e95
commit
a9240f097f
|
@ -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/google/json5format
|
||||
WORKDIR $SRC
|
||||
|
||||
COPY build.sh $SRC/
|
||||
COPY fuzz $SRC/json5format/fuzz
|
|
@ -0,0 +1,22 @@
|
|||
#!/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.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
cd $SRC/json5format
|
||||
cargo fuzz build -O
|
||||
ls -la ./fuzz
|
||||
ls -la ./fuzz/target
|
||||
cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_parse $OUT/fuzz_parse
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
target
|
||||
corpus
|
||||
artifacts
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
[package]
|
||||
name = "json5format-fuzz"
|
||||
version = "0.0.0"
|
||||
authors = ["David Korczynski <david@adalogics.com>"]
|
||||
publish = false
|
||||
edition = "2018"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
||||
[dependencies]
|
||||
libfuzzer-sys = "0.3"
|
||||
|
||||
[dependencies.json5format]
|
||||
path = ".."
|
||||
|
||||
# Prevent this from interfering with workspaces
|
||||
[workspace]
|
||||
members = ["."]
|
||||
|
||||
[[bin]]
|
||||
name = "fuzz_parse"
|
||||
path = "fuzz_targets/fuzz_parse.rs"
|
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use json5format::*;
|
||||
use std::str;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
if let Ok(utf8) = str::from_utf8(data) {
|
||||
ParsedDocument::from_str(utf8, None);
|
||||
}
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
homepage: "https://crates.io/crates/json5format"
|
||||
main_repo: "https://github.com/google/json5format"
|
||||
primary_contact: "richkadel@google.com"
|
||||
sanitizers:
|
||||
- address
|
||||
fuzzing_engines:
|
||||
- libfuzzer
|
||||
language: rust
|
||||
auto_ccs:
|
||||
- "david@adalogics.com"
|
Loading…
Reference in New Issue