static BOOL ConvertFindDataAToW(LPWIN32_FIND_DATAA lpFindFileDataA,
LPWIN32_FIND_DATAW lpFindFileDataW)
{
- int length;
+ size_t length;
WCHAR* unicodeFileName;
if (!lpFindFileDataA || !lpFindFileDataW)
{
if (FilePatternMatchA(pFileSearch->pDirent->d_name, pFileSearch->lpPattern))
{
- strcpy(lpFindFileData->cFileName, pFileSearch->pDirent->d_name);
- namelen = strlen(lpFindFileData->cFileName);
+ strncpy(lpFindFileData->cFileName, pFileSearch->pDirent->d_name, MAX_PATH);
+ namelen = strnlen(lpFindFileData->cFileName, MAX_PATH);
pathlen = strlen(pFileSearch->lpPath);
fullpath = (char*)malloc(pathlen + namelen + 2);
{
free(fullpath);
SetLastError(map_posix_err(errno));
- return FALSE;
+ continue;
}
free(fullpath);
/* Skip FIFO entries. */
if (S_ISFIFO(fileStat.st_mode))
continue;
-
lpFindFileData->dwFileAttributes = 0;
if (S_ISDIR(fileStat.st_mode))