This commit is contained in:
zeho11
2022-12-08 18:02:19 +09:00
parent cb81e81985
commit db07b24342
3 changed files with 36 additions and 3 deletions

View File

@ -1939,7 +1939,7 @@ int fsp_fuse_intf_AddDirInfo(void *buf, const char *name,
}
SizeA = lstrlenA(name);
if (SizeA > 1020)
if (SizeA > 255 * 4)
{
fsp_fuse_intf_LogBadDirInfo(filedesc->PosixPath, name,
"too long");
@ -2000,7 +2000,7 @@ static NTSTATUS fsp_fuse_intf_FixDirInfo(FSP_FILE_SYSTEM *FileSystem,
NTSTATUS Result;
SizeA = lstrlenA(filedesc->PosixPath);
PosixPath = MemAlloc(SizeA + 1 + 1020 + 1);
PosixPath = MemAlloc(SizeA + 1 + 255 * 4 + 1);
if (0 == PosixPath)
{
Result = STATUS_INSUFFICIENT_RESOURCES;
@ -2049,7 +2049,7 @@ static NTSTATUS fsp_fuse_intf_FixDirInfo(FSP_FILE_SYSTEM *FileSystem,
else
{
PosixPathEnd = 0;
SizeA = WideCharToMultiByte(CP_UTF8, 0, DirInfo->FileNameBuf, SizeW, PosixName, 1020, 0, 0);
SizeA = WideCharToMultiByte(CP_UTF8, 0, DirInfo->FileNameBuf, SizeW, PosixName, 255 * 4, 0, 0);
if (0 == SizeA)
{
/* this should never happen because we just converted using MultiByteToWideChar */