- Validate the buffer size before copying to it

svn path=/trunk/; revision=40358
This commit is contained in:
Cameron Gutman 2009-04-04 00:41:42 +00:00
parent 8f9cc82b53
commit 7d73a8c6e8

View file

@ -126,6 +126,12 @@ VOID DGDeliverData(
("Target Buffer: %x, Source Buffer: %x, Size %d\n",
Current->Buffer, DataBuffer, DataSize));
if (DataSize > Current->BufferSize)
{
Current->Complete(Current->Context, STATUS_BUFFER_TOO_SMALL, DataSize);
return;
}
/* Copy the data into buffer provided by the user */
RtlCopyMemory( Current->Buffer,
DataBuffer,