[Libreoffice-commits] online.git: wsd/ClientSession.cpp
Pranav Kant
pranavk at collabora.co.uk
Wed Oct 25 20:22:43 UTC 2017
wsd/ClientSession.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 6e86fefc4eba5546096f4c4d974ffc65d11570ae
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Wed Oct 25 13:16:57 2017 -0700
tdf#99744: Check if params exist before accessing them
Change-Id: I5a36281f281b5d1fa4a8b7a3551ce1d49c2efaad
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index e19f3352..df6df09c 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -236,8 +236,12 @@ bool ClientSession::_handleInput(const char *buffer, int length)
else if (tokens[0] == "saveas")
{
std::string newFileName, path;
- getTokenString(tokens[1], "fileName", newFileName);
- getTokenString(tokens[2], "path", path);
+ if (tokens.size() > 1)
+ getTokenString(tokens[1], "fileName", newFileName);
+
+ if (tokens.size() > 2)
+ getTokenString(tokens[2], "path", path);
+
docBroker->saveFileAs(getId(), newFileName, path);
}
else if (tokens[0] == "save")
More information about the Libreoffice-commits
mailing list