Finished making the changes.
authorJamesB7 <jfb@zer7.com>
Sun, 29 Apr 2012 22:34:47 +0000 (19:34 -0300)
committerJamesB7 <jfb@zer7.com>
Sun, 29 Apr 2012 22:34:47 +0000 (19:34 -0300)
commitd9d66c646534c4825a4a368792c2032e6009be15
tree87152da5e1be490db26074de6e6c7bdb3ecd8101
parentc03eccac3c0138d5adf10c162d41379304a0eb8c
Finished making the changes.

There are two types of checks that were being done before:
(1) offset < 0? size < 0? offset + size > buffer.Length? This is trivial to get around. If I make both offset and size positive but have the sum overflow, it will pass all three checks.

(2) offset in range? size in range? If the buffer is very large this might run into overflow issues with its checking, though fine most of the time...

Is the offset in range? And is the size in range against buffer.Length - offset (which we know to be >= 0 from the earlier offset check)? This method of bounds checking is not in any danger from two's complement overflows.
mcs/class/System/System.Net.Sockets/Socket.cs