Fix buffer size checks for IOCTL_VIDEO_SET_COLOR_REGISTERS.

svn path=/trunk/; revision=15829
This commit is contained in:
Filip Navara 2005-06-07 16:26:14 +00:00
parent d06d236296
commit e7f345e0a2
2 changed files with 2 additions and 2 deletions

View file

@ -480,7 +480,7 @@ VBEStartIO(
if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
RequestPacket->InputBufferLength <
(((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
sizeof(VIDEO_CLUT))
FIELD_OFFSET(VIDEO_CLUT, LookupTable))
{
RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
return TRUE;

View file

@ -223,7 +223,7 @@ VGAStartIO(PVOID DeviceExtension,
if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
RequestPacket->InputBufferLength <
(((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
sizeof(VIDEO_CLUT))
FIELD_OFFSET(VIDEO_CLUT, LookupTable))
{
RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
return TRUE;