mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -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)
|
||||
{
|
||||
ASSERT(
|
||||
FileName.Buffer <= StreamPart.Buffer &&
|
||||
StreamPart.Buffer + StreamPart.Length / sizeof(WCHAR) <=
|
||||
FileName.Buffer + FileName.Length / sizeof(WCHAR));
|
||||
(PUINT8)FileName.Buffer + sizeof(WCHAR) <= (PUINT8)StreamPart.Buffer &&
|
||||
(PUINT8)StreamPart.Buffer + StreamPart.Length <=
|
||||
(PUINT8)FileName.Buffer + FileName.Length);
|
||||
|
||||
FileName.Length = (USHORT)
|
||||
(((PUINT8)StreamPart.Buffer + StreamPart.Length / sizeof(WCHAR)) -
|
||||
(PUINT8)FileName.Buffer - 1);
|
||||
((PUINT8)StreamPart.Buffer - (PUINT8)FileName.Buffer + StreamPart.Length);
|
||||
|
||||
MainFileName.Length = MainFileName.MaximumLength = (USHORT)
|
||||
((PUINT8)StreamPart.Buffer - (PUINT8)FileName.Buffer - 1);
|
||||
((PUINT8)StreamPart.Buffer - (PUINT8)FileName.Buffer - sizeof(WCHAR));
|
||||
MainFileName.Buffer = FileName.Buffer;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user