Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2003-01-12 11:37:20 +0300
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2003-01-12 11:37:20 +0300
commitdb545706f54651bd90fe3e4ebc0462f8a7497d85 (patch)
treef40b83f29cdd321e746f08757e29a259fec909bb /mcs/class/System/System.Collections.Specialized
parent89c6198dab54f14ba108f859980f450925e3111e (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-xmcs/class/System/System.Collections.Specialized/ChangeLog4
-rwxr-xr-xmcs/class/System/System.Collections.Specialized/StringCollection.cs14
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);