mirror of
https://github.com/reactos/reactos.git
synced 2024-08-11 21:58:10 +00:00
- Validate the buffer size before copying to it
svn path=/trunk/; revision=40358
This commit is contained in:
parent
8f9cc82b53
commit
7d73a8c6e8
|
@ -126,6 +126,12 @@ VOID DGDeliverData(
|
||||||
("Target Buffer: %x, Source Buffer: %x, Size %d\n",
|
("Target Buffer: %x, Source Buffer: %x, Size %d\n",
|
||||||
Current->Buffer, DataBuffer, DataSize));
|
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 */
|
/* Copy the data into buffer provided by the user */
|
||||||
RtlCopyMemory( Current->Buffer,
|
RtlCopyMemory( Current->Buffer,
|
||||||
DataBuffer,
|
DataBuffer,
|
||||||
|
|
Loading…
Reference in a new issue