Enabled the check of the correct buffer size in some functions.

svn path=/trunk/; revision=2334
This commit is contained in:
Hartmut Birr 2001-11-01 10:41:53 +00:00
parent 287fa79a6a
commit 24f81ff1c1

View file

@ -1,4 +1,4 @@
/* $Id: volume.c,v 1.12 2001/07/28 10:12:36 hbirr Exp $
/* $Id: volume.c,v 1.13 2001/11/01 10:41:53 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -38,9 +38,8 @@ FsdGetFsVolumeInformation(PFILE_OBJECT FileObject,
DPRINT("LabelLength %lu\n", LabelLength);
DPRINT("Label %S\n", DeviceObject->Vpb->VolumeLabel);
/* FIXME: This does not work correctly! Why?? */
// if (*BufferLength < (sizeof(FILE_FS_VOLUME_INFORMATION) + LabelLength));
// return(STATUS_BUFFER_OVERFLOW);
if (*BufferLength < (sizeof(FILE_FS_VOLUME_INFORMATION) + LabelLength*sizeof(WCHAR)))
return(STATUS_BUFFER_OVERFLOW);
/* valid entries */
FsVolumeInfo->VolumeSerialNumber = DeviceObject->Vpb->SerialNumber;
@ -100,9 +99,8 @@ FsdGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
DPRINT("FsdGetFsSizeInformation()\n");
DPRINT("FsSizeInfo = %p\n", FsSizeInfo);
/* FIXME: This does not work correctly! Why?? */
// if (*BufferLength < sizeof(FILE_FS_SIZE_INFORMATION));
// return(STATUS_BUFFER_OVERFLOW);
if (*BufferLength < sizeof(FILE_FS_SIZE_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
DeviceExt = DeviceObject->DeviceExtension;
@ -152,9 +150,8 @@ FsdGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
DPRINT("BufferLength %lu\n", *BufferLength);
DPRINT("Required length %lu\n", sizeof(FILE_FS_DEVICE_INFORMATION));
/* FIXME: This does not work correctly! Why?? */
// if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION));
// return(STATUS_BUFFER_OVERFLOW);
if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
FsDeviceInfo->DeviceType = FILE_DEVICE_DISK;
FsDeviceInfo->Characteristics = 0; /* FIXME: fix this !! */