summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-02 11:29:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-06-03 16:03:23 +0100
commite9ca7bc9134075979eab37f10c64c518438f7592 (patch)
tree04f482d402af19fc77b36b9782e9b6039c530d3a /vcl
parent77d1e0c49adea959dd418de9b6cf9901e01be3ae (diff)
add quattro pro fuzzer
Change-Id: Ic9ba37af508eabce528ea57ae5839b1cd603b3e1
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Executable_qpwfuzzer.mk48
-rw-r--r--vcl/Module_vcl.mk1
-rw-r--r--vcl/commonfuzzer.mk5
-rw-r--r--vcl/workben/qpwfuzzer.cxx28
4 files changed, 82 insertions, 0 deletions
diff --git a/vcl/Executable_qpwfuzzer.mk b/vcl/Executable_qpwfuzzer.mk
new file mode 100644
index 000000000000..57a25b8b2cbe
--- /dev/null
+++ b/vcl/Executable_qpwfuzzer.mk
@@ -0,0 +1,48 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+include $(SRCDIR)/vcl/commonfuzzer.mk
+
+$(eval $(call gb_Executable_Executable,qpwfuzzer))
+
+$(eval $(call gb_Executable_use_api,qpwfuzzer,\
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_Executable_use_externals,qpwfuzzer,\
+ $(fuzzer_externals) \
+))
+
+$(eval $(call gb_Executable_set_include,qpwfuzzer,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/vcl/inc \
+))
+
+$(eval $(call gb_Executable_use_libraries,qpwfuzzer,\
+ qpw \
+ $(fuzzer_libraries) \
+))
+
+$(eval $(call gb_Executable_use_static_libraries,qpwfuzzer,\
+ findsofficepath \
+ ulingu \
+ fuzzer \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,qpwfuzzer,\
+ vcl/workben/qpwfuzzer \
+))
+
+$(eval $(call gb_Executable_add_libs,qpwfuzzer,\
+ -lFuzzingEngine \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 035eeafd2f0c..cf89ec28d019 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -135,6 +135,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
Executable_ww2fuzzer \
Executable_ww6fuzzer \
Executable_ww8fuzzer \
+ Executable_qpwfuzzer \
))
endif
diff --git a/vcl/commonfuzzer.mk b/vcl/commonfuzzer.mk
index fa1320913563..7dd731d5b8dd 100644
--- a/vcl/commonfuzzer.mk
+++ b/vcl/commonfuzzer.mk
@@ -13,6 +13,8 @@ fuzzer_externals = \
orcus \
orcus-parser \
boost_filesystem \
+ boost_system \
+ boost_iostreams \
curl \
harfbuzz \
graphite \
@@ -43,6 +45,7 @@ fuzzer_libraries = \
swd \
writerfilter \
textfd \
+ sc \
sdfilt \
sd \
sdd \
@@ -60,6 +63,8 @@ fuzzer_libraries = \
drawinglayer \
editeng \
filterconfig \
+ for \
+ forui \
fsstorage \
fwe \
fwi \
diff --git a/vcl/workben/qpwfuzzer.cxx b/vcl/workben/qpwfuzzer.cxx
new file mode 100644
index 000000000000..8f0e4e85e162
--- /dev/null
+++ b/vcl/workben/qpwfuzzer.cxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <tools/stream.hxx>
+#include "commonfuzzer.hxx"
+
+extern "C" bool TestImportQPW(SvStream &rStream);
+
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
+{
+ TypicalFuzzerInitialize(argc, argv);
+ return 0;
+}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+ SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
+ (void)TestImportQPW(aStream);
+ return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */