Kaydet (Commit) a886fbfb authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Silence upcoming GCC 8 -Werror=sizeof-pointer-memaccess

...("error: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’
call is the same expression as the source; did you mean to use the size of the
destination?") in a place where the use of strncpy instead of strcpy (introduced
with 9276f7d5 "fdo#32263") doesn't help prevent
any buffer overflows anyway (the target's size already having been checked to be
sufficiently large).

Change-Id: I70773538f4092f1306fb00f1fa7f9138e06894e5
Reviewed-on: https://gerrit.libreoffice.org/48391Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst ad9871a5
......@@ -365,7 +365,7 @@ static bool osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, s
n = strlen(pszDirectory);
if (n + sizeof(DOT_CONFIG) < nMax)
{
strncpy(pszDirectory+n, DOT_CONFIG, sizeof(DOT_CONFIG));
strcpy(pszDirectory+n, DOT_CONFIG); // safe
// try to create dir if not present
bool dirOK = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment