[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - wsd/ClientSession.cpp

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


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

New commits:
commit 9bc61c5f9865f3ae120a4ad45381aee2cb8ff8bf
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:26:34 2019 +0100

    Tolerate empty first lines.
    
    Change-Id: Ib9aaf82560fc3f5adaa97f40a3de5f3946c6f65d

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index f1ae9e897..9c8a4cd2a 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