diff --git a/main/rsc/source/rscpp/cpp1.c b/main/rsc/source/rscpp/cpp1.c index 2b521b03a7..b659587f5e 100644 --- a/main/rsc/source/rscpp/cpp1.c +++ b/main/rsc/source/rscpp/cpp1.c @@ -329,7 +329,8 @@ nRunde++; cerror("Can't open input file \"%s\"", useargv[1]); exit(IO_ERROR); } - strncpy(work, useargv[1], sizeof(work)); /* Remember input filename */ + strncpy(work, useargv[1], NWORK+1); /* Remember input filename */ + work[NWORK] = '\0'; break; } /* Else, just get stdin */ case 0: /* No args? */ diff --git a/main/sal/osl/unx/profile.c b/main/sal/osl/unx/profile.c index c1c9a41b0e..3440d5bf75 100644 --- a/main/sal/osl/unx/profile.c +++ b/main/sal/osl/unx/profile.c @@ -2065,6 +2065,7 @@ static sal_Bool osl_ProfileSwapProfileNames(osl_TProfileImpl* pProfile) osl_ProfileGenerateExtension(pProfile->m_FileName,"bak",pszBakFile); strncpy(pszIniFile,pProfile->m_FileName,PATH_MAX); + pszIniFile[PATH_MAX-1] = '\0'; osl_ProfileGenerateExtension(pProfile->m_FileName,"tmp",pszTmpFile);