mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 00:13:01 -05:00
dll: fuse: correct error handling when name exceeds limit
Related to b62e1e920b292c4928395db89e96fada29dd7c38
This commit is contained in:
parent
46054c03fe
commit
e550e261f0
@ -1949,18 +1949,16 @@ int fsp_fuse_intf_AddDirInfo(void *buf, const char *name,
|
||||
SizeW = MultiByteToWideChar(CP_UTF8, 0, name, SizeA, DirInfo->FileNameBuf, 255);
|
||||
if (0 == SizeW)
|
||||
{
|
||||
fsp_fuse_intf_LogBadDirInfo(filedesc->PosixPath, name,
|
||||
"MultiByteToWideChar failed");
|
||||
return 0;
|
||||
}
|
||||
else if (255 == SizeW)
|
||||
{
|
||||
if (255 < MultiByteToWideChar(CP_UTF8, 0, name, SizeA, NULL, 0))
|
||||
if (ERROR_INSUFFICIENT_BUFFER == GetLastError())
|
||||
{
|
||||
fsp_fuse_intf_LogBadDirInfo(filedesc->PosixPath, name,
|
||||
"too long");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fsp_fuse_intf_LogBadDirInfo(filedesc->PosixPath, name,
|
||||
"MultiByteToWideChar failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(DirInfo, 0, sizeof *DirInfo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user