summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2019-03-15 12:13:41 +0200
committerTor Lillqvist <tml@collabora.com>2019-03-15 12:22:26 +0200
commit9da36e5362324509e47bc9ae93d31fc3250f96c0 (patch)
tree1ba6363fc3397de13ad31656c9f88042e80ca35b
parentef025d623a90484674f1fe0fdf2dabce36d2aa8d (diff)
Don't return an empty C string, the caller is not prepared for that
If the called gets a pointer to an empty C string, it will send the message "commandvalues: " to the JavaScript bits. That will cause an exception as it expects JSON after the commandvalues: keyword. Instead return a nullptr. The called is prepared to handle that. Change-Id: Ia1efa967668ba518993edb7945f064758b660b96
-rw-r--r--desktop/source/lib/init.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 54948cf3511d..88970631ce48 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3630,6 +3630,9 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
}
OUString aHeaders = pDoc->getRowColumnHeaders(aRectangle);
+ if (aHeaders == "")
+ return nullptr;
+
OString aString = OUStringToOString(aHeaders, RTL_TEXTENCODING_UTF8);
char* pMemory = static_cast<char*>(malloc(aString.getLength() + 1));