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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri May 17 13:28:08 UTC 2019


 wsd/ClientSession.cpp |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 8be093ed671eaf58124ebfc0404d241ee56d64de
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri May 17 14:26:07 2019 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri May 17 14:27:47 2019 +0100

    Tolerate empty first lines.
    
    Change-Id: Ib9aaf82560fc3f5adaa97f40a3de5f3946c6f65d

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 596c1c757..df68df351 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -87,6 +87,12 @@ bool ClientSession::_handleInput(const char *buffer, int length)
         return false;
     }
 
+    if (tokens.size() < 1)
+    {
+        sendTextFrame("error: cmd=empty kind=unknown");
+        return false;
+    }
+
     LOOLWSD::dumpIncomingTrace(docBroker->getJailId(), getId(), firstLine);
 
     if (LOOLProtocol::tokenIndicatesUserInteraction(tokens[0]))
@@ -97,7 +103,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
     }
     if (tokens[0] == "loolclient")
     {
-        if (tokens.size() < 1)
+        if (tokens.size() < 2)
         {
             sendTextFrame("error: cmd=loolclient kind=badprotocolversion");
             return false;


More information about the Libreoffice-commits mailing list