From: Martin Quinson Date: Fri, 4 Jan 2019 16:43:22 +0000 (+0100) Subject: use strncpy instead of strcpy to please sonar X-Git-Tag: v3_22~697 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5ad9346749f40f374abc834749d0c288440e1500?hp=07decd2d8999a3a299c0cd4ae4ad7d36420200c5 use strncpy instead of strcpy to please sonar --- diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 4aea1a5f51..be68fe11de 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -563,7 +563,7 @@ static void smpi_init_privatization_dlopen(const std::string& executable) void* libhandle = dlopen(libname.c_str(), RTLD_LAZY); // get library name from path char fullpath[512] = {'\0'}; - strcpy(fullpath, libname.c_str()); + strncpy(fullpath, libname.c_str(), 511); #if not defined(__APPLE__) int ret = dl_iterate_phdr(visit_libs, fullpath); if (ret == 0)