desktop/source/lib/init.cxx | 3 +++ 1 file changed, 3 insertions(+) New commits: commit 22de481db334fcce404cdcf88183cd544cd19271 Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Fri Mar 15 12:13:41 2019 +0200 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Fri Mar 15 12:31:13 2019 +0200
Don't return an empty C string, the caller is not prepared for that If the caller receives 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 caller is prepared to handle that. Change-Id: Ia1efa967668ba518993edb7945f064758b660b96 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 78c3d27474ed..160ac0d68749 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3568,6 +3568,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)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits