diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-01-12 11:37:20 +0300 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-01-12 11:37:20 +0300 |
commit | db545706f54651bd90fe3e4ebc0462f8a7497d85 (patch) | |
tree | f40b83f29cdd321e746f08757e29a259fec909bb /mcs/class/System/System.Collections.Specialized | |
parent | 89c6198dab54f14ba108f859980f450925e3111e (diff) |
2003-01-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* StringCollection.cs: fixed range checks in CopyTo.
svn path=/trunk/mcs/; revision=10407
Diffstat (limited to 'mcs/class/System/System.Collections.Specialized')
-rwxr-xr-x | mcs/class/System/System.Collections.Specialized/ChangeLog | 4 | ||||
-rwxr-xr-x | mcs/class/System/System.Collections.Specialized/StringCollection.cs | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/mcs/class/System/System.Collections.Specialized/ChangeLog b/mcs/class/System/System.Collections.Specialized/ChangeLog index 15179a7128a..0e61ece6ad0 100755 --- a/mcs/class/System/System.Collections.Specialized/ChangeLog +++ b/mcs/class/System/System.Collections.Specialized/ChangeLog @@ -1,3 +1,7 @@ +2003-01-12 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * StringCollection.cs: fixed range checks in CopyTo. + 2002-11-06 Daniel Stodden <stodden@in.tum.de> * ListDictionary.cs: diff --git a/mcs/class/System/System.Collections.Specialized/StringCollection.cs b/mcs/class/System/System.Collections.Specialized/StringCollection.cs index 661aa1379ca..ac36d454884 100755 --- a/mcs/class/System/System.Collections.Specialized/StringCollection.cs +++ b/mcs/class/System/System.Collections.Specialized/StringCollection.cs @@ -126,11 +126,10 @@ namespace System.Collections.Specialized { } else if (index < 0) {
throw new ArgumentOutOfRangeException("index");
} else if (array.Rank > 1) {
- throw new ArgumentException("array");
- } else if (index >= array.Length) {
- throw new ArgumentException("index");
+ throw new ArgumentException("Rank must be 1", "array");
} else if (array.Length - index < count) {
- throw new ArgumentException("array");
+ throw new ArgumentException("Count is smaller than the number of objects to copy",
+ "array");
}
Array.Copy(entries, 0, array, index, count);
@@ -142,11 +141,10 @@ namespace System.Collections.Specialized { } else if (index < 0) {
throw new ArgumentOutOfRangeException("index");
} else if (array.Rank > 1) {
- throw new ArgumentException("array");
- } else if (index >= array.Length) {
- throw new ArgumentException("index");
+ throw new ArgumentException("Rank must be 1", "array");
} else if (array.Length - index < count) {
- throw new ArgumentException("array");
+ throw new ArgumentException("Count is smaller than the number of objects to copy",
+ "array");
}
Array.Copy(entries, 0, array, index, count);
|