aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects/qpid-proton
diff options
context:
space:
mode:
Diffstat (limited to 'projects/qpid-proton')
-rw-r--r--projects/qpid-proton/Dockerfile28
-rwxr-xr-xprojects/qpid-proton/build.sh30
-rw-r--r--projects/qpid-proton/c_CMakeLists.patch13
-rw-r--r--projects/qpid-proton/c_tests_fuzz_CMakeLists.patch13
-rw-r--r--projects/qpid-proton/project.yaml4
5 files changed, 88 insertions, 0 deletions
diff --git a/projects/qpid-proton/Dockerfile b/projects/qpid-proton/Dockerfile
new file mode 100644
index 00000000..0c2e6ead
--- /dev/null
+++ b/projects/qpid-proton/Dockerfile
@@ -0,0 +1,28 @@
+# Copyright 2018 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 gcr.io/oss-fuzz-base/base-builder
+MAINTAINER jdanek@redhat.com
+RUN apt-get update && \
+ apt-get install -y \
+ cmake
+
+RUN git clone git://git.apache.org/qpid-proton.git
+
+WORKDIR qpid-proton
+COPY build.sh $SRC/
+COPY c_tests_fuzz_CMakeLists.patch $SRC/
+COPY c_CMakeLists.patch $SRC/
diff --git a/projects/qpid-proton/build.sh b/projects/qpid-proton/build.sh
new file mode 100755
index 00000000..ba7e1ff9
--- /dev/null
+++ b/projects/qpid-proton/build.sh
@@ -0,0 +1,30 @@
+#!/bin/bash -eu
+# Copyright 2018 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.
+#
+################################################################################
+
+patch -p1 < $SRC/c_tests_fuzz_CMakeLists.patch
+patch -p1 < $SRC/c_CMakeLists.patch
+mkdir build
+pushd build
+ cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_FUZZ_TESTING=ON -DFUZZ_REGRESSION_TESTS=OFF
+ pushd c/tests/fuzz/
+ make -j $(nproc)
+ popd
+ cp c/tests/fuzz/{fuzz-connection-driver,fuzz-message-decode} $OUT/
+popd
+
+zip -j $OUT/fuzz-connection-driver_seed_corpus.zip c/tests/fuzz/fuzz-connection-driver/corpus/* c/tests/fuzz/fuzz-connection-driver/crash/*
+zip -j $OUT/fuzz-message-decode_seed_corpus.zip c/tests/fuzz/fuzz-message-decode/corpus/* c/tests/fuzz/fuzz-message-decode/crash/*
diff --git a/projects/qpid-proton/c_CMakeLists.patch b/projects/qpid-proton/c_CMakeLists.patch
new file mode 100644
index 00000000..5b186de4
--- /dev/null
+++ b/projects/qpid-proton/c_CMakeLists.patch
@@ -0,0 +1,13 @@
+diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
+index 40b50374..2247e0f1 100644
+--- a/c/CMakeLists.txt
++++ b/c/CMakeLists.txt
+@@ -539,7 +539,7 @@ if (BUILD_WITH_CXX)
+ endif (BUILD_WITH_CXX)
+
+ add_library (
+- qpid-proton-core SHARED
++ qpid-proton-core STATIC
+ ${qpid-proton-core}
+ ${qpid-proton-layers}
+ ${qpid-proton-platform}
diff --git a/projects/qpid-proton/c_tests_fuzz_CMakeLists.patch b/projects/qpid-proton/c_tests_fuzz_CMakeLists.patch
new file mode 100644
index 00000000..140789b3
--- /dev/null
+++ b/projects/qpid-proton/c_tests_fuzz_CMakeLists.patch
@@ -0,0 +1,13 @@
+diff --git a/c/tests/fuzz/CMakeLists.txt b/c/tests/fuzz/CMakeLists.txt
+index f870d617..054ec6d6 100644
+--- a/c/tests/fuzz/CMakeLists.txt
++++ b/c/tests/fuzz/CMakeLists.txt
+@@ -33,6 +33,8 @@ add_library (StandaloneFuzzTargetMain STATIC StandaloneFuzzTargetMain.c Standalo
+ macro (pn_add_fuzz_test test)
+ add_executable (${test} ${ARGN})
+ target_link_libraries (${test} qpid-proton-core ${FUZZING_LIBRARY})
++ # -lFuzzingEngine is a C++ library, which needs c++ std lib
++ set_target_properties(${test} PROPERTIES LINKER_LANGUAGE CXX)
+
+ if (FUZZ_REGRESSION_TESTS)
+ # StandaloneFuzzTargetMain cannot walk directory trees
diff --git a/projects/qpid-proton/project.yaml b/projects/qpid-proton/project.yaml
index cd28b3c5..fb0405bf 100644
--- a/projects/qpid-proton/project.yaml
+++ b/projects/qpid-proton/project.yaml
@@ -3,3 +3,7 @@ primary_contact: "jross@apache.org"
auto_ccs:
- "security@apache.org"
- "jdanek@redhat.com"
+sanitizers:
+ - address
+ - memory
+ - undefined