[Libreoffice-commits] core.git: vcl/workben

Caolán McNamara caolanm at redhat.com
Thu Mar 23 15:02:11 UTC 2017


 vcl/workben/602fuzzer.cxx    |    6 ++++++
 vcl/workben/bmpfuzzer.cxx    |    6 ++++++
 vcl/workben/commonfuzzer.hxx |   15 +++++++++------
 vcl/workben/dxffuzzer.cxx    |    6 ++++++
 vcl/workben/epsfuzzer.cxx    |    6 ++++++
 vcl/workben/giffuzzer.cxx    |    6 ++++++
 vcl/workben/hwpfuzzer.cxx    |    6 ++++++
 vcl/workben/jpgfuzzer.cxx    |    6 ++++++
 vcl/workben/lwpfuzzer.cxx    |    6 ++++++
 vcl/workben/metfuzzer.cxx    |    6 ++++++
 vcl/workben/olefuzzer.cxx    |    6 ++++++
 vcl/workben/pcdfuzzer.cxx    |    6 ++++++
 vcl/workben/pctfuzzer.cxx    |    6 ++++++
 vcl/workben/pcxfuzzer.cxx    |    6 ++++++
 vcl/workben/pngfuzzer.cxx    |    6 ++++++
 vcl/workben/ppmfuzzer.cxx    |    6 ++++++
 vcl/workben/pptfuzzer.cxx    |   15 +++++++++++++++
 vcl/workben/psdfuzzer.cxx    |    6 ++++++
 vcl/workben/rasfuzzer.cxx    |    6 ++++++
 vcl/workben/svmfuzzer.cxx    |    6 ++++++
 vcl/workben/tgafuzzer.cxx    |    6 ++++++
 vcl/workben/tiffuzzer.cxx    |    6 ++++++
 vcl/workben/wmffuzzer.cxx    |    6 ++++++
 vcl/workben/xbmfuzzer.cxx    |    6 ++++++
 vcl/workben/xpmfuzzer.cxx    |    6 ++++++
 25 files changed, 162 insertions(+), 6 deletions(-)

New commits:
commit 502dde2118cf840e691595614b15f26c3b5b509b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 23 12:01:15 2017 +0000

    ofz: readjust LLVMFuzzerInitialize to get ppt SdDLL::Init outside leak detect
    
    Change-Id: I01a6d19ef27c4678929e8e7554569c9219ea83f6

diff --git a/vcl/workben/602fuzzer.cxx b/vcl/workben/602fuzzer.cxx
index 04c8726d9016..b653befab885 100644
--- a/vcl/workben/602fuzzer.cxx
+++ b/vcl/workben/602fuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool TestImport602(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);
diff --git a/vcl/workben/bmpfuzzer.cxx b/vcl/workben/bmpfuzzer.cxx
index acd541473747..cc96044c53d2 100644
--- a/vcl/workben/bmpfuzzer.cxx
+++ b/vcl/workben/bmpfuzzer.cxx
@@ -11,6 +11,12 @@
 #include <vcl/dibtools.hxx>
 #include "commonfuzzer.hxx"
 
+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);
diff --git a/vcl/workben/commonfuzzer.hxx b/vcl/workben/commonfuzzer.hxx
index 4357476efc9f..f88d835cf59d 100644
--- a/vcl/workben/commonfuzzer.hxx
+++ b/vcl/workben/commonfuzzer.hxx
@@ -72,11 +72,8 @@ extern "C"
     __attribute__((weak)) void __lsan_enable();
 }
 
-extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
+void CommonInitialize(int *argc, char ***argv)
 {
-    if (__lsan_disable)
-        __lsan_disable();
-
     setenv("SAL_USE_VCLPLUGIN", "svp", 1);
     setenv("JPEGMEM", "768M", 1);
     setenv("SAL_WMF_COMPLEXCLIP_VIA_REGION", "1", 1);
@@ -104,11 +101,17 @@ extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
     psp::PrintFontManager::get();
     //get the printer info
     Printer::GetPrinterQueues();
+}
+
+void TypicalFuzzerInitialize(int *argc, char ***argv)
+{
+    if (__lsan_disable)
+        __lsan_disable();
+
+    CommonInitialize(argc, argv);
 
     if (__lsan_enable)
         __lsan_enable();
-
-    return 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/workben/dxffuzzer.cxx b/vcl/workben/dxffuzzer.cxx
index a6e9fadad1b6..7320a24fb786 100644
--- a/vcl/workben/dxffuzzer.cxx
+++ b/vcl/workben/dxffuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool idxGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/epsfuzzer.cxx b/vcl/workben/epsfuzzer.cxx
index 9b037298b7f9..1cc1c9fe8f5e 100644
--- a/vcl/workben/epsfuzzer.cxx
+++ b/vcl/workben/epsfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool ipsGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/giffuzzer.cxx b/vcl/workben/giffuzzer.cxx
index 20167da9002e..623f9b03a6a1 100644
--- a/vcl/workben/giffuzzer.cxx
+++ b/vcl/workben/giffuzzer.cxx
@@ -11,6 +11,12 @@
 #include <../source/filter/igif/gifread.hxx>
 #include "commonfuzzer.hxx"
 
+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);
diff --git a/vcl/workben/hwpfuzzer.cxx b/vcl/workben/hwpfuzzer.cxx
index 49ee3dc330f7..3beab7e3ee4d 100644
--- a/vcl/workben/hwpfuzzer.cxx
+++ b/vcl/workben/hwpfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool TestImportHWP(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);
diff --git a/vcl/workben/jpgfuzzer.cxx b/vcl/workben/jpgfuzzer.cxx
index 429401afe9bf..711c5e2ee871 100644
--- a/vcl/workben/jpgfuzzer.cxx
+++ b/vcl/workben/jpgfuzzer.cxx
@@ -11,6 +11,12 @@
 #include <../source/filter/jpeg/jpeg.hxx>
 #include "commonfuzzer.hxx"
 
+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);
diff --git a/vcl/workben/lwpfuzzer.cxx b/vcl/workben/lwpfuzzer.cxx
index 4fe06a2b17af..5a10861f1cdb 100644
--- a/vcl/workben/lwpfuzzer.cxx
+++ b/vcl/workben/lwpfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool TestImportLWP(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);
diff --git a/vcl/workben/metfuzzer.cxx b/vcl/workben/metfuzzer.cxx
index 3bf42e03c4a9..6f919c1842d5 100644
--- a/vcl/workben/metfuzzer.cxx
+++ b/vcl/workben/metfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool imeGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/olefuzzer.cxx b/vcl/workben/olefuzzer.cxx
index ec0d79bfb2ab..f9a717122e59 100644
--- a/vcl/workben/olefuzzer.cxx
+++ b/vcl/workben/olefuzzer.cxx
@@ -62,6 +62,12 @@ void TestImportOLE2(SvStream &rStream, size_t nSize)
 
 }
 
+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);
diff --git a/vcl/workben/pcdfuzzer.cxx b/vcl/workben/pcdfuzzer.cxx
index bcfe48b3ed6e..942f21e5646e 100644
--- a/vcl/workben/pcdfuzzer.cxx
+++ b/vcl/workben/pcdfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool icdGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/pctfuzzer.cxx b/vcl/workben/pctfuzzer.cxx
index 08cf4be6c92e..5d56208b547a 100644
--- a/vcl/workben/pctfuzzer.cxx
+++ b/vcl/workben/pctfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool iptGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/pcxfuzzer.cxx b/vcl/workben/pcxfuzzer.cxx
index 3e11befa96fb..6f07f5e4d6aa 100644
--- a/vcl/workben/pcxfuzzer.cxx
+++ b/vcl/workben/pcxfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool ipxGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/pngfuzzer.cxx b/vcl/workben/pngfuzzer.cxx
index fbeb2acd7423..c3f631e1e502 100644
--- a/vcl/workben/pngfuzzer.cxx
+++ b/vcl/workben/pngfuzzer.cxx
@@ -11,6 +11,12 @@
 #include <vcl/pngread.hxx>
 #include "commonfuzzer.hxx"
 
+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);
diff --git a/vcl/workben/ppmfuzzer.cxx b/vcl/workben/ppmfuzzer.cxx
index 152f08dd438d..a0a3cb475401 100644
--- a/vcl/workben/ppmfuzzer.cxx
+++ b/vcl/workben/ppmfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool ipbGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/pptfuzzer.cxx b/vcl/workben/pptfuzzer.cxx
index 8c9345339fbf..45c1571171f0 100644
--- a/vcl/workben/pptfuzzer.cxx
+++ b/vcl/workben/pptfuzzer.cxx
@@ -13,6 +13,21 @@
 
 extern "C" bool TestImportPPT(SvStream &rStream);
 
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
+{
+    if (__lsan_disable)
+        __lsan_disable();
+
+    CommonInitialize(argc, argv);
+
+    comphelper::getProcessServiceFactory()->createInstance("com.sun.star.comp.Draw.PresentationDocument");
+
+    if (__lsan_enable)
+        __lsan_enable();
+
+    return 0;
+}
+
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
 {
     SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
diff --git a/vcl/workben/psdfuzzer.cxx b/vcl/workben/psdfuzzer.cxx
index 664e1d066ebb..5f9c3bec680f 100644
--- a/vcl/workben/psdfuzzer.cxx
+++ b/vcl/workben/psdfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool ipdGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/rasfuzzer.cxx b/vcl/workben/rasfuzzer.cxx
index 3e738ebdec9e..2cc4314b55dc 100644
--- a/vcl/workben/rasfuzzer.cxx
+++ b/vcl/workben/rasfuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool iraGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/svmfuzzer.cxx b/vcl/workben/svmfuzzer.cxx
index 2c98fda0a9d0..7d2bb1874094 100644
--- a/vcl/workben/svmfuzzer.cxx
+++ b/vcl/workben/svmfuzzer.cxx
@@ -11,6 +11,12 @@
 #include <vcl/gdimtf.hxx>
 #include "commonfuzzer.hxx"
 
+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);
diff --git a/vcl/workben/tgafuzzer.cxx b/vcl/workben/tgafuzzer.cxx
index cc6f8ba44dc1..4ac9bd19a788 100644
--- a/vcl/workben/tgafuzzer.cxx
+++ b/vcl/workben/tgafuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool itgGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/tiffuzzer.cxx b/vcl/workben/tiffuzzer.cxx
index 07300514a18b..200c0d339c03 100644
--- a/vcl/workben/tiffuzzer.cxx
+++ b/vcl/workben/tiffuzzer.cxx
@@ -13,6 +13,12 @@
 
 extern "C" bool itiGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
 
+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);
diff --git a/vcl/workben/wmffuzzer.cxx b/vcl/workben/wmffuzzer.cxx
index 8b5054e9070a..2300f181c673 100644
--- a/vcl/workben/wmffuzzer.cxx
+++ b/vcl/workben/wmffuzzer.cxx
@@ -12,6 +12,12 @@
 #include <vcl/wmf.hxx>
 #include "commonfuzzer.hxx"
 
+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);
diff --git a/vcl/workben/xbmfuzzer.cxx b/vcl/workben/xbmfuzzer.cxx
index 7f41bf426d0a..499b4ecff5da 100644
--- a/vcl/workben/xbmfuzzer.cxx
+++ b/vcl/workben/xbmfuzzer.cxx
@@ -11,6 +11,12 @@
 #include <../source/filter/ixbm/xbmread.hxx>
 #include "commonfuzzer.hxx"
 
+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);
diff --git a/vcl/workben/xpmfuzzer.cxx b/vcl/workben/xpmfuzzer.cxx
index b4a8fc11586d..95a4692bb0c8 100644
--- a/vcl/workben/xpmfuzzer.cxx
+++ b/vcl/workben/xpmfuzzer.cxx
@@ -11,6 +11,12 @@
 #include <../source/filter/ixpm/xpmread.hxx>
 #include "commonfuzzer.hxx"
 
+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);


More information about the Libreoffice-commits mailing list