aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects/libprotobuf-mutator
diff options
context:
space:
mode:
authorGravatar Vitaly Buka <vitalybuka@gmail.com>2017-02-04 03:16:17 -0800
committerGravatar GitHub <noreply@github.com>2017-02-04 03:16:17 -0800
commit83aea115463d093bdefd3b58ee359113387df18e (patch)
treefacceb281829e0244f7752c33a5ac42ba4e5f063 /projects/libprotobuf-mutator
parent3c77078af2ea4fffcaedb7db9928c2eb4c42aab8 (diff)
Add XML example from libprotobuf-mutator (#346)
Diffstat (limited to 'projects/libprotobuf-mutator')
-rw-r--r--projects/libprotobuf-mutator/Dockerfile25
-rwxr-xr-xprojects/libprotobuf-mutator/build.sh41
-rw-r--r--projects/libprotobuf-mutator/libxml2_example.options2
-rw-r--r--projects/libprotobuf-mutator/libxml2_experiment.options2
-rw-r--r--projects/libprotobuf-mutator/project.yaml2
5 files changed, 72 insertions, 0 deletions
diff --git a/projects/libprotobuf-mutator/Dockerfile b/projects/libprotobuf-mutator/Dockerfile
new file mode 100644
index 00000000..5791cd2b
--- /dev/null
+++ b/projects/libprotobuf-mutator/Dockerfile
@@ -0,0 +1,25 @@
+# Copyright 2017 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 ossfuzz/base-builder
+MAINTAINER vitalybuka@gmail.com
+RUN apt-get install -y make autoconf automake libtool pkg-config cmake ninja-build liblzma-dev libz-dev
+
+RUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git
+WORKDIR libprotobuf-mutator
+
+COPY build.sh $SRC/
+COPY libxml2* $SRC/
diff --git a/projects/libprotobuf-mutator/build.sh b/projects/libprotobuf-mutator/build.sh
new file mode 100755
index 00000000..f84bd9df
--- /dev/null
+++ b/projects/libprotobuf-mutator/build.sh
@@ -0,0 +1,41 @@
+#!/bin/bash -eu
+#
+# Copyright 2017 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.
+#
+################################################################################
+
+cp $SRC/*.options $OUT/
+
+mkdir -p build
+pushd build
+rm -rf *
+cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \
+ -DLIB_PROTO_MUTATOR_WITH_ASAN=OFF \
+ -DLIB_PROTO_MUTATOR_FUZZER_LIBRARIES=FuzzingEngine
+ninja libxml2_example && cp libxml2_example $OUT/
+popd
+
+# Experimental fuzzer to compare coverage with default one.
+CXXFLAGS="$CXXFLAGS -DLIB_PROTO_MUTATOR_XML2_NO_FLATTENING=1"
+mkdir -p build_exp
+pushd build_exp
+rm -rf *
+cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \
+ -DLIB_PROTO_MUTATOR_WITH_ASAN=OFF \
+ -DLIB_PROTO_MUTATOR_FUZZER_LIBRARIES=FuzzingEngine
+ninja libxml2_example && cp libxml2_example $OUT/libxml2_experiment
+popd
+
+
diff --git a/projects/libprotobuf-mutator/libxml2_example.options b/projects/libprotobuf-mutator/libxml2_example.options
new file mode 100644
index 00000000..bd935bfc
--- /dev/null
+++ b/projects/libprotobuf-mutator/libxml2_example.options
@@ -0,0 +1,2 @@
+[libfuzzer]
+max_len=100000
diff --git a/projects/libprotobuf-mutator/libxml2_experiment.options b/projects/libprotobuf-mutator/libxml2_experiment.options
new file mode 100644
index 00000000..bd935bfc
--- /dev/null
+++ b/projects/libprotobuf-mutator/libxml2_experiment.options
@@ -0,0 +1,2 @@
+[libfuzzer]
+max_len=100000
diff --git a/projects/libprotobuf-mutator/project.yaml b/projects/libprotobuf-mutator/project.yaml
new file mode 100644
index 00000000..39da2f8a
--- /dev/null
+++ b/projects/libprotobuf-mutator/project.yaml
@@ -0,0 +1,2 @@
+auto_ccs:
+ - "vitalybuka@gmail.com"