[MOUNTMGR] Properly validate input buffer size

This avoids IOCTL_MOUNTMGR_QUERY_POINTS always failing
This commit is contained in:
Pierre Schweitzer 2019-09-05 08:22:59 +02:00
parent 77657c22c9
commit 70d29ec423
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -1745,7 +1745,7 @@ MountMgrQueryPoints(IN PDEVICE_EXTENSION DeviceExtension,
/* We can't go beyond */ /* We can't go beyond */
if (((ULONG)MountPoint->SymbolicLinkNameLength + MountPoint->UniqueIdLength + if (((ULONG)MountPoint->SymbolicLinkNameLength + MountPoint->UniqueIdLength +
MountPoint->DeviceNameLength) < Stack->Parameters.DeviceIoControl.InputBufferLength) MountPoint->DeviceNameLength) > Stack->Parameters.DeviceIoControl.InputBufferLength)
{ {
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;
} }