From ef6355819d8131fdb9e571405b8287c00481fa14 Mon Sep 17 00:00:00 2001 From: manunio Date: Fri, 5 Aug 2022 20:19:02 +0530 Subject: [PATCH] mxj: initial integration (#8155) --- projects/mxj/Dockerfile | 22 ++++++++++++++++++++++ projects/mxj/build.sh | 18 ++++++++++++++++++ projects/mxj/fuzz.go | 15 +++++++++++++++ projects/mxj/project.yaml | 10 ++++++++++ 4 files changed, 65 insertions(+) create mode 100644 projects/mxj/Dockerfile create mode 100755 projects/mxj/build.sh create mode 100644 projects/mxj/fuzz.go create mode 100644 projects/mxj/project.yaml diff --git a/projects/mxj/Dockerfile b/projects/mxj/Dockerfile new file mode 100644 index 000000000..160f08d9e --- /dev/null +++ b/projects/mxj/Dockerfile @@ -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 +RUN git clone --depth 1 https://github.com/clbanning/mxj mxj +COPY build.sh $SRC/ +COPY fuzz.go $SRC/mxj +WORKDIR $SRC/mxj diff --git a/projects/mxj/build.sh b/projects/mxj/build.sh new file mode 100755 index 000000000..081c6c09d --- /dev/null +++ b/projects/mxj/build.sh @@ -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 . FuzzMapXml fuzz_map_xml gofuzz diff --git a/projects/mxj/fuzz.go b/projects/mxj/fuzz.go new file mode 100644 index 000000000..da69ef322 --- /dev/null +++ b/projects/mxj/fuzz.go @@ -0,0 +1,15 @@ +package mxj + +func FuzzMapXml(data []byte) int { + m, err := NewMapXml(data) + if err != nil { + return 0 + } + + _, err = m.Xml() + if err != nil { + return 0 + } + + return 1 +} diff --git a/projects/mxj/project.yaml b/projects/mxj/project.yaml new file mode 100644 index 000000000..84532bc6e --- /dev/null +++ b/projects/mxj/project.yaml @@ -0,0 +1,10 @@ +homepage: "https://github.com/clbanning/mxj" +language: go +fuzzing_engines: + - libfuzzer +sanitizers: + - address +main_repo: "https://github.com/clbanning/mxj" +vendor_ccs: + - maxnair.dev@gmail.com +file_github_issue: true