[MOUNTMGR] Fix pool memory disclosure in QueryPointsFromMemory (#3022)

This commit is contained in:
Nguyen Trung Khanh 2020-08-17 21:45:35 +07:00 committed by GitHub
parent 61d89dec8e
commit 9adcacdbc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -335,6 +335,7 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
/* Now, ensure output buffer can hold everything */ /* Now, ensure output buffer can hold everything */
Stack = IoGetCurrentIrpStackLocation(Irp); Stack = IoGetCurrentIrpStackLocation(Irp);
MountPoints = (PMOUNTMGR_MOUNT_POINTS)Irp->AssociatedIrp.SystemBuffer; MountPoints = (PMOUNTMGR_MOUNT_POINTS)Irp->AssociatedIrp.SystemBuffer;
RtlZeroMemory(MountPoints, Stack->Parameters.DeviceIoControl.OutputBufferLength);
/* Ensure we set output to let user reallocate! */ /* Ensure we set output to let user reallocate! */
MountPoints->Size = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalSymLinks * sizeof(MOUNTMGR_MOUNT_POINT) + TotalSize; MountPoints->Size = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalSymLinks * sizeof(MOUNTMGR_MOUNT_POINT) + TotalSize;