Author: cgutman
Date: Sat Apr 4 04:41:42 2009
New Revision: 40358
URL:
http://svn.reactos.org/svn/reactos?rev=40358&view=rev
Log:
- Validate the buffer size before copying to it
Modified:
trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c
Modified: trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/d…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c [iso-8859-1] Sat Apr 4
04:41:42 2009
@@ -126,6 +126,12 @@
("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,