diff --git a/drivers/filesystems/fastfat/dir.c b/drivers/filesystems/fastfat/dir.c index 18c6dcc2ca..6c7d660c53 100644 --- a/drivers/filesystems/fastfat/dir.c +++ b/drivers/filesystems/fastfat/dir.c @@ -356,6 +356,9 @@ VfatGetFileBothInformation( NTSTATUS Status; ULONG BytesToCopy = 0; + if ((sizeof(FILE_BOTH_DIR_INFORMATION) + DirContext->LongNameU.Length) > BufferLength) + return STATUS_BUFFER_OVERFLOW; + *Written = 0; Status = STATUS_BUFFER_OVERFLOW;