wsd/FileServer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 0d4bc145ba957982194808a8f43688d01885f6c3 Author: Pranav Kant <pran...@collabora.co.uk> Date: Mon Dec 18 19:18:43 2017 +0530 Explicit is better than implicit; avoid invalid mem access The form.get function is something like this: const std::string& get(const std::string& abc) { return abc; } passing a string literal implicitly gets converted to temporary std::string whose reference is then returned and used. This causes crash, atleast for me, on building online with GCC 7 Change-Id: I09d0aeea57a3dbeeefd1bb28ff645723714aa6b4 Reviewed-on: https://gerrit.libreoffice.org/46727 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit 75c2147b7f774afccf55bb93f7fae79efb615361) Reviewed-on: https://gerrit.libreoffice.org/46730 Reviewed-by: pranavk <pran...@collabora.co.uk> Tested-by: pranavk <pran...@collabora.co.uk> diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index a0e74a2c..501966ba 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -439,10 +439,10 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco:: std::string preprocess = *getUncompressedFile(relPath); HTMLForm form(request, message); - const std::string& accessToken = form.get("access_token", ""); - const std::string& accessTokenTtl = form.get("access_token_ttl", ""); + const std::string accessToken = form.get("access_token", ""); + const std::string accessTokenTtl = form.get("access_token_ttl", ""); LOG_TRC("access_token=" << accessToken << ", access_token_ttl=" << accessTokenTtl); - const std::string& accessHeader = form.get("access_header", ""); + const std::string accessHeader = form.get("access_header", ""); LOG_TRC("access_header=" << accessHeader); // Escape bad characters in access token. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits