summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-23 11:18:00 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-23 21:52:13 +0100
commita886fbfb54b1b770e57862a4ce58f99dbdb368fa (patch)
tree9afc3ceb1a7139e8db261bbcdc22cc87c035e742 /sal
parentad9871a5d1119593068f7e3a01d4249b4dff982a (diff)
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 9276f7d5740a28b342db2a9bcd8644ff2f4f5742 "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/48391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/security.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index 9b76060f40a2..49a0320bc023 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -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;