diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2010-06-29 02:15:27 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2010-06-29 02:15:27 +0400 |
commit | e8a3238bc73f3dc109c5ccf754dc0e6fcf44f135 (patch) | |
tree | 9205b2ca41f6007dd843fbd2f52e9ba057500d3b /mcs/class | |
parent | 77aeaa06e5219c93aaca072acbe74a8433843a2a (diff) |
2010-06-28 Gonzalo Paniagua Javier <gonzalo@novell.com>
* IPAddress.cs: verify the last IPv4 digit too.
Fixes bug #612135.
svn path=/branches/mono-2-6/mcs/; revision=159634
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/System/System.Net/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System/System.Net/IPAddress.cs | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog index 5e8c73d2cc7..92865300cfa 100644 --- a/mcs/class/System/System.Net/ChangeLog +++ b/mcs/class/System/System.Net/ChangeLog @@ -1,3 +1,8 @@ +2010-06-28 Gonzalo Paniagua Javier <gonzalo@novell.com> + + * IPAddress.cs: verify the last IPv4 digit too. + Fixes bug #612135. + 2010-06-16 Gonzalo Paniagua Javier <gonzalo@novell.com> * HttpWebRequest.cs: DELETE allows an entity body. diff --git a/mcs/class/System/System.Net/IPAddress.cs b/mcs/class/System/System.Net/IPAddress.cs index a375eaa7baf..eea47cd8ff9 100644 --- a/mcs/class/System/System.Net/IPAddress.cs +++ b/mcs/class/System/System.Net/IPAddress.cs @@ -282,10 +282,10 @@ namespace System.Net { #endif } + if (val > 0xFF) + return null; // e.g. 256.0.0.1 if (i == (ips.Length - 1)) i = 3; - else if (val > 0xFF) - return null; // e.g. 256.0.0.1 for (int j = 0; val > 0; j++, val /= 0x100) a |= (val & 0xFF) << ((i - j) << 3); } |