mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-31 14:55:07 -05:00
sys: create: correctly compute file name lengths when streams are involved
This commit is contained in:
@@ -224,16 +224,15 @@ static NTSTATUS FspFsvolCreateNoLock(
|
|||||||
if (0 != StreamPart.Buffer)
|
if (0 != StreamPart.Buffer)
|
||||||
{
|
{
|
||||||
ASSERT(
|
ASSERT(
|
||||||
FileName.Buffer <= StreamPart.Buffer &&
|
(PUINT8)FileName.Buffer + sizeof(WCHAR) <= (PUINT8)StreamPart.Buffer &&
|
||||||
StreamPart.Buffer + StreamPart.Length / sizeof(WCHAR) <=
|
(PUINT8)StreamPart.Buffer + StreamPart.Length <=
|
||||||
FileName.Buffer + FileName.Length / sizeof(WCHAR));
|
(PUINT8)FileName.Buffer + FileName.Length);
|
||||||
|
|
||||||
FileName.Length = (USHORT)
|
FileName.Length = (USHORT)
|
||||||
(((PUINT8)StreamPart.Buffer + StreamPart.Length / sizeof(WCHAR)) -
|
((PUINT8)StreamPart.Buffer - (PUINT8)FileName.Buffer + StreamPart.Length);
|
||||||
(PUINT8)FileName.Buffer - 1);
|
|
||||||
|
|
||||||
MainFileName.Length = MainFileName.MaximumLength = (USHORT)
|
MainFileName.Length = MainFileName.MaximumLength = (USHORT)
|
||||||
((PUINT8)StreamPart.Buffer - (PUINT8)FileName.Buffer - 1);
|
((PUINT8)StreamPart.Buffer - (PUINT8)FileName.Buffer - sizeof(WCHAR));
|
||||||
MainFileName.Buffer = FileName.Buffer;
|
MainFileName.Buffer = FileName.Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user