[Libreoffice-commits] online.git: fuzzer/ClientSession.cpp wsd/LOOLWSD.hpp

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu May 7 12:05:15 UTC 2020


 fuzzer/ClientSession.cpp |    5 +++--
 wsd/LOOLWSD.hpp          |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 19745e2e44362af2edb2e9086323a0a7b69b7d8f
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu May 7 10:26:38 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu May 7 14:04:57 2020 +0200

    libfuzzer: fix build
    
    And bypass configuration access at two new places, so the fuzzer can
    find more interesting failures.
    
    Change-Id: I4c09172e781a7c6120b8c4befe1a84fdd74f2ddc
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93617
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/fuzzer/ClientSession.cpp b/fuzzer/ClientSession.cpp
index a9a6ad657..edd4053d1 100644
--- a/fuzzer/ClientSession.cpp
+++ b/fuzzer/ClientSession.cpp
@@ -16,12 +16,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
     std::string uri;
     Poco::URI uriPublic;
     std::string docKey = "/fuzz/fuzz.odt";
-    auto docBroker = std::make_shared<DocumentBroker>(uri, uriPublic, docKey);
+    auto docBroker = std::make_shared<DocumentBroker>(DocumentBroker::ChildType::Interactive, uri,
+                                                      uriPublic, docKey);
 
     std::shared_ptr<ProtocolHandlerInterface> ws;
     std::string id;
     bool isReadOnly = false;
-    const ServerURL serverURL("", "");
+    const ServerURL serverURL;
     auto session
         = std::make_shared<ClientSession>(ws, id, docBroker, uriPublic, isReadOnly, serverURL);
 
diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp
index dc0a68e06..3172f8bb7 100644
--- a/wsd/LOOLWSD.hpp
+++ b/wsd/LOOLWSD.hpp
@@ -273,7 +273,7 @@ public:
     static bool isSSLEnabled()
     {
 #if ENABLE_SSL
-        return LOOLWSD::SSLEnabled.get();
+        return !Util::isFuzzing() && LOOLWSD::SSLEnabled.get();
 #else
         return false;
 #endif
@@ -282,7 +282,7 @@ public:
     static bool isSSLTermination()
     {
 #if ENABLE_SSL
-        return LOOLWSD::SSLTermination.get();
+        return !Util::isFuzzing() && LOOLWSD::SSLTermination.get();
 #else
         return false;
 #endif


More information about the Libreoffice-commits mailing list