[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - libreofficekit/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jul 18 08:58:47 UTC 2018


 libreofficekit/qa/tilebench/tilebench.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 1c8264b4a3305c3f4fcde726a3516bb58fff326a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Jul 15 21:14:32 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jul 18 10:58:13 2018 +0200

    coverity#1437959 Copy into fixed size buffer
    
    Change-Id: I5578e195c834b2a3ceacd5c528f58d1d03502c2e
    Reviewed-on: https://gerrit.libreoffice.org/57461
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index 16fc047ce655..4cb76dd1366e 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -313,23 +313,22 @@ int main( int argc, char* argv[] )
         mode = argv[arg++];
     }
 
-    char user_url[8046];;
-    strcpy(user_url, "file:///");
-    strcat(user_url, argv[1]);
-    strcat(user_url, "../user");
+    std::string user_url("file:///");
+    user_url.append(argv[1]);
+    user_url.append("../user");
 
     if (pre_init)
     {
         aTimes.emplace_back("pre-initialization");
         setenv("LOK_WHITELIST_LANGUAGES", "en_US", 0);
         // coverity[tainted_string] - build time test tool
-        lok_preinit(argv[1], user_url);
+        lok_preinit(argv[1], user_url.c_str());
         aTimes.emplace_back();
     }
 
     aTimes.emplace_back("initialization");
     // coverity[tainted_string] - build time test tool
-    Office *pOffice = lok_cpp_init(argv[1], user_url);
+    Office *pOffice = lok_cpp_init(argv[1], user_url.c_str());
     if (pOffice == nullptr)
     {
         fprintf(stderr, "Failed to initialize Office from %s\n", argv[1]);


More information about the Libreoffice-commits mailing list