Fix a really nasty bug in NTFS: it was possible to perform a buffer overflow when reading the bitmap data.

svn path=/trunk/; revision=65186
This commit is contained in:
Pierre Schweitzer 2014-11-02 17:53:18 +00:00
parent 760375811e
commit b304d6f14a

View file

@ -70,7 +70,7 @@ NtfsGetFreeClusters(PDEVICE_EXTENSION DeviceExt)
BitmapDataSize = AttributeDataLength(&DataContext->Record);
ASSERT((BitmapDataSize * 8) >= (DeviceExt->NtfsInfo.SectorCount / DeviceExt->NtfsInfo.SectorsPerCluster));
BitmapData = ExAllocatePoolWithTag(NonPagedPool, BitmapDataSize, TAG_NTFS);
BitmapData = ExAllocatePoolWithTag(NonPagedPool, ROUND_UP(BitmapDataSize, DeviceExt->NtfsInfo.BytesPerSector), TAG_NTFS);
if (BitmapData == NULL)
{
ReleaseAttributeContext(DataContext);