From bd29f86804407c583cd02fbf310191408176c0f4 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Mon, 6 Feb 2017 14:48:22 +0000 Subject: Fix CopyTo argument validation Fixes #2669. --- csharp/src/Google.Protobuf/Collections/MapField.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'csharp/src/Google.Protobuf/Collections/MapField.cs') 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)); } -- cgit v1.2.3