mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-08 04:52:10 -05:00
sys: create: correctly compute file name lengths when streams are involved
This commit is contained in:
parent
e58ac1fbde
commit
1d435269bd
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user