From 8be1a99cbe06647e70a931ac21e35113cb1dbf21 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 31 May 2024 16:25:16 +0700 Subject: Fix data length check --- crypto/src/crypto/BufferedAsymmetricBlockCipher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs b/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs index be933a028..382d6a2cb 100644 --- a/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs +++ b/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs @@ -131,7 +131,7 @@ namespace Org.BouncyCastle.Crypto #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER public override int ProcessBytes(ReadOnlySpan input, Span output) { - Check.DataLength(input, buffer.Length - bufOff, "attempt to process message too long for cipher"); + Check.DataLength(input.Length > buffer.Length - bufOff, "attempt to process message too long for cipher"); input.CopyTo(buffer.AsSpan(bufOff)); bufOff += input.Length; -- cgit 1.4.1