diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-07-31 06:07:21 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-07-31 06:07:21 +0400 |
commit | 2dede109a450deef76876a65f601743a23071b97 (patch) | |
tree | 63d1633e40fddaad6cc205f17105e40b07ed6412 /mcs/class/System/System.Net.Sockets | |
parent | 23c27cf065ca682d22891270b8dd02e107675418 (diff) |
2003-07-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* NetworkStream.cs:
* Socket.cs: fixed array boundary checks. 0 sized arrays are allowed.
svn path=/trunk/mcs/; revision=16921
Diffstat (limited to 'mcs/class/System/System.Net.Sockets')
-rw-r--r-- | mcs/class/System/System.Net.Sockets/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System/System.Net.Sockets/NetworkStream.cs | 12 | ||||
-rw-r--r-- | mcs/class/System/System.Net.Sockets/Socket.cs | 12 |
3 files changed, 17 insertions, 12 deletions
diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog index 236f5139a63..b3a908c22bb 100644 --- a/mcs/class/System/System.Net.Sockets/ChangeLog +++ b/mcs/class/System/System.Net.Sockets/ChangeLog @@ -1,3 +1,8 @@ +2003-07-31 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * NetworkStream.cs: + * Socket.cs: fixed array boundary checks. 0 sized arrays are allowed. + 2003-07-18 Andreas Nahr <ClassDevelopment@A-SoftTech.com> * Socket.cs: Added GetHashCode method diff --git a/mcs/class/System/System.Net.Sockets/NetworkStream.cs b/mcs/class/System/System.Net.Sockets/NetworkStream.cs index 426cd41a008..f522184830a 100644 --- a/mcs/class/System/System.Net.Sockets/NetworkStream.cs +++ b/mcs/class/System/System.Net.Sockets/NetworkStream.cs @@ -132,10 +132,10 @@ namespace System.Net.Sockets if (buffer == null) throw new ArgumentNullException ("buffer is null"); int len = buffer.Length; - if(offset<0 || offset>=len) { + if(offset<0 || offset>len) { throw new ArgumentOutOfRangeException("offset exceeds the size of buffer"); } - if(offset+size<0 || offset+size>len) { + if(size<0 || offset+size>len) { throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer"); } @@ -158,10 +158,10 @@ namespace System.Net.Sockets throw new ArgumentNullException ("buffer is null"); int len = buffer.Length; - if(offset<0 || offset>=len) { + if(offset<0 || offset>len) { throw new ArgumentOutOfRangeException("offset exceeds the size of buffer"); } - if(offset+size<0 || offset+size>len) { + if(size<0 || offset+size>len) { throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer"); } @@ -245,10 +245,10 @@ namespace System.Net.Sockets if (buffer == null) throw new ArgumentNullException ("buffer is null"); - if(offset<0 || offset>=buffer.Length) { + if(offset<0 || offset>buffer.Length) { throw new ArgumentOutOfRangeException("offset exceeds the size of buffer"); } - if(offset+size < 0 || offset+size>buffer.Length) { + if(size < 0 || offset+size>buffer.Length) { throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer"); } diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs index 40ea103a1c5..3d8476cae98 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.cs @@ -857,10 +857,10 @@ namespace System.Net.Sockets if(buf==null) { throw new ArgumentNullException("buffer is null"); } - if(offset<0 || offset >= buf.Length) { + if(offset<0 || offset > buf.Length) { throw new ArgumentOutOfRangeException("offset exceeds the size of buffer"); } - if(offset+size<0 || offset+size > buf.Length) { + if(size<0 || offset+size > buf.Length) { throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer"); } @@ -913,10 +913,10 @@ namespace System.Net.Sockets if(remote_end==null) { throw new ArgumentNullException("remote endpoint is null"); } - if(offset<0 || offset>=buf.Length) { + if(offset<0 || offset>buf.Length) { throw new ArgumentOutOfRangeException("offset exceeds the size of buffer"); } - if(offset+size<0 || offset+size>buf.Length) { + if(size<0 || offset+size>buf.Length) { throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer"); } @@ -1018,10 +1018,10 @@ namespace System.Net.Sockets if(remote_end==null) { throw new ArgumentNullException("remote endpoint is null"); } - if(offset<0 || offset>=buffer.Length) { + if(offset<0 || offset>buffer.Length) { throw new ArgumentOutOfRangeException("offset exceeds the size of buffer"); } - if(offset+size<0 || offset+size>buffer.Length) { + if(size<0 || offset+size>buffer.Length) { throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer"); } |