mirror of
https://github.com/winfsp/winfsp.git
synced 2025-12-25 21:42:55 -06:00
sys: FspUnicodePathIsValid()
This commit is contained in:
@@ -809,6 +809,9 @@ static NTSTATUS FspFsvolSetRenameInformation(
|
||||
if (FileNode->IsRootDirectory)
|
||||
/* cannot rename root directory */
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
if (!FspUnicodePathIsValid(&FileNode->FileName, FALSE))
|
||||
/* cannot rename streams (WinFsp limitation) */
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (0 != TargetFileNode)
|
||||
{
|
||||
@@ -831,6 +834,13 @@ static NTSTATUS FspFsvolSetRenameInformation(
|
||||
if (L'\\' == Suffix.Buffer[0])
|
||||
FspUnicodePathSuffix(&Suffix, &NewFileName, &Suffix);
|
||||
|
||||
if (!FspUnicodePathIsValid(&Remain, FALSE) || !FspUnicodePathIsValid(&Suffix, FALSE))
|
||||
{
|
||||
/* cannot rename streams (WinFsp limitation) */
|
||||
Result = STATUS_INVALID_PARAMETER;
|
||||
goto unlock_exit;
|
||||
}
|
||||
|
||||
AppendBackslash = sizeof(WCHAR) < Remain.Length;
|
||||
NewFileName.Length = NewFileName.MaximumLength =
|
||||
Remain.Length + AppendBackslash * sizeof(WCHAR) + Suffix.Length;
|
||||
|
||||
Reference in New Issue
Block a user