[Libreoffice-commits] online.git: loolwsd/Log.cpp

Miklos Vajna vmiklos at collabora.co.uk
Wed Apr 20 07:10:58 UTC 2016


 loolwsd/Log.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5e2937bf7917868ab80f49666dcc330740d9a5a8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Apr 20 09:10:26 2016 +0200

    Log: strcpy -> strncpy
    
    Change-Id: I2929ad46b422e6e55e198064c2930028df844630

diff --git a/loolwsd/Log.cpp b/loolwsd/Log.cpp
index c40cb11..9038a78 100644
--- a/loolwsd/Log.cpp
+++ b/loolwsd/Log.cpp
@@ -75,7 +75,7 @@ namespace Log
 
         char procName[32]; // we really need only 16
         if (prctl(PR_GET_NAME, reinterpret_cast<unsigned long>(procName), 0, 0, 0) != 0)
-            strcpy(procName, "<noid>");
+            strncpy(procName, "<noid>", sizeof(procName) - 1);
 
         const char *appName = (Source.inited ? Source.id.c_str() : "<shutdown>");
         assert(strlen(appName) + 32 + 28 < 1024 - 1);


More information about the Libreoffice-commits mailing list