aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf/Collections
diff options
context:
space:
mode:
authorGravatar Jon Skeet <jonskeet@google.com>2017-02-06 14:48:22 +0000
committerGravatar Jon Skeet <skeet@pobox.com>2017-02-06 18:24:19 +0000
commitbd29f86804407c583cd02fbf310191408176c0f4 (patch)
treef35d64af8dc5406369142b7cbfe9b602bd98fa5d /csharp/src/Google.Protobuf/Collections
parent39756643df2f88805649595e651b719c8f5a4dea (diff)
Fix CopyTo argument validation
Fixes #2669.
Diffstat (limited to 'csharp/src/Google.Protobuf/Collections')
-rw-r--r--csharp/src/Google.Protobuf/Collections/MapField.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs
index 537ce261..ef5651c9 100644
--- a/csharp/src/Google.Protobuf/Collections/MapField.cs
+++ b/csharp/src/Google.Protobuf/Collections/MapField.cs
@@ -715,7 +715,7 @@ namespace Google.Protobuf.Collections
{
throw new ArgumentOutOfRangeException(nameof(arrayIndex));
}
- if (arrayIndex + Count >= array.Length)
+ if (arrayIndex + Count > array.Length)
{
throw new ArgumentException("Not enough space in the array", nameof(array));
}
@@ -746,7 +746,7 @@ namespace Google.Protobuf.Collections
{
throw new ArgumentOutOfRangeException(nameof(index));
}
- if (index + Count >= array.Length)
+ if (index + Count > array.Length)
{
throw new ArgumentException("Not enough space in the array", nameof(array));
}