Skip to content

Commit 515cc90

Browse files
authored
BUGFIX: Offset Validation with -1 Length fixed to be directly length
BUGFIX: Offset Validation with -1 Length fixed to be direct length and also fixed a comment with a repeated "the the" typo. Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent 0d32c70 commit 515cc90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

HashifyNet/Core/BlockTransformerBase.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ public void TransformBytes(byte[] data, int offset, int count, CancellationToken
157157
throw new ArgumentException("data.Length must be greater than 0.", nameof(data));
158158
}
159159

160-
if (offset < 0 || offset >= data.Length - 1)
160+
if (offset < 0 || offset >= data.Length)
161161
{
162162
throw new ArgumentOutOfRangeException(nameof(offset), "Offset must be a value greater than or equal to zero and less than the length of the array minus one.");
163163
}
164164

165165
if (count <= 0 || count > data.Length - offset)
166166
{
167-
throw new ArgumentOutOfRangeException(nameof(count), "Count must be a value greater than zero and less than the the remaining length of the array after the offset value.");
167+
throw new ArgumentOutOfRangeException(nameof(count), "Count must be a value greater than zero and less than the remaining length of the array after the offset value.");
168168
}
169169

170170
TransformBytes(new ArraySegment<byte>(data, offset, count), cancellationToken);
@@ -382,3 +382,4 @@ protected void TransformBytesInternal(ArraySegment<byte> data, CancellationToken
382382
}
383383

384384
}
385+

0 commit comments

Comments
 (0)