Kaydet (Commit) aa436024 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

coverity#983493 String Overflow

Change-Id: I31a167508ca33e8d6ccc13690c013c39566b9447
üst ce55457a
......@@ -124,23 +124,26 @@ static oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName,
*pstr++ = '/';
*pstr = '\0';
size_t reminder = PATH_MAX - strlen(path);
if(reminder > strlen(pszName))
{
strncat(path, pszName, reminder);
strcat(path, pszName);
if (access(path, 0) == 0)
{
char szRealPathBuf[PATH_MAX + 1] = "";
if (access(path, 0) == 0)
{
char szRealPathBuf[PATH_MAX] = "";
if( NULL == realpath(path, szRealPathBuf) || (strlen(szRealPathBuf) >= (sal_uInt32)Max))
return osl_Process_E_Unknown;
if( NULL == realpath(path, szRealPathBuf) || (strlen(szRealPathBuf) >= (sal_uInt32)Max))
return osl_Process_E_Unknown;
strcpy(pszBuffer, path);
strcpy(pszBuffer, path);
return osl_Process_E_None;
}
return osl_Process_E_None;
if (*pchr == ':')
pchr++;
}
if (*pchr == ':')
pchr++;
}
}
......
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