https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e95751ab786e0266f430e…
commit e95751ab786e0266f430e6f65218835774d328d9
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Dec 9 10:59:37 2017 +0100
[FASTFAT] Calculate more accurately buffer length in VfatGetAllInformation().
---
drivers/filesystems/fastfat/finfo.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/filesystems/fastfat/finfo.c b/drivers/filesystems/fastfat/finfo.c
index 766a4f38ee..03b7d3cc93 100644
--- a/drivers/filesystems/fastfat/finfo.c
+++ b/drivers/filesystems/fastfat/finfo.c
@@ -1188,6 +1188,8 @@ VfatGetAllInformation(
if (*BufferLength < FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName))
return STATUS_BUFFER_OVERFLOW;
+ *BufferLength -= (sizeof(FILE_ACCESS_INFORMATION) + sizeof(FILE_MODE_INFORMATION) +
sizeof(FILE_ALIGNMENT_INFORMATION));
+
/* Basic Information */
Status = VfatGetBasicInformation(FileObject, Fcb, DeviceExt,
&Info->BasicInformation, BufferLength);
if (!NT_SUCCESS(Status)) return Status;
@@ -1200,15 +1202,9 @@ VfatGetAllInformation(
/* EA Information */
Status = VfatGetEaInformation(FileObject, Fcb, DeviceExt,
&Info->EaInformation, BufferLength);
if (!NT_SUCCESS(Status)) return Status;
- /* Access Information: The IO-Manager adds this information */
- *BufferLength -= sizeof(FILE_ACCESS_INFORMATION);
/* Position Information */
Status = VfatGetPositionInformation(FileObject, Fcb, DeviceExt,
&Info->PositionInformation, BufferLength);
if (!NT_SUCCESS(Status)) return Status;
- /* Mode Information: The IO-Manager adds this information */
- *BufferLength -= sizeof(FILE_MODE_INFORMATION);
- /* Alignment Information: The IO-Manager adds this information */
- *BufferLength -= sizeof(FILE_ALIGNMENT_INFORMATION);
/* Name Information */
Status = VfatGetNameInformation(FileObject, Fcb, DeviceExt,
&Info->NameInformation, BufferLength);