diff options
author | Jon Skeet <jonskeet@google.com> | 2017-02-06 14:48:22 +0000 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2017-02-06 18:24:19 +0000 |
commit | bd29f86804407c583cd02fbf310191408176c0f4 (patch) | |
tree | f35d64af8dc5406369142b7cbfe9b602bd98fa5d /csharp/src/Google.Protobuf | |
parent | 39756643df2f88805649595e651b719c8f5a4dea (diff) | |
download | protobuf-bd29f86804407c583cd02fbf310191408176c0f4.tar.gz protobuf-bd29f86804407c583cd02fbf310191408176c0f4.tar.bz2 protobuf-bd29f86804407c583cd02fbf310191408176c0f4.zip |
Fix CopyTo argument validation
Fixes #2669.
Diffstat (limited to 'csharp/src/Google.Protobuf')
-rw-r--r-- | csharp/src/Google.Protobuf/Collections/MapField.cs | 4 |
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)); } |