From 02581a8b87b9b5d2629ae9f2bc5439caafe1e8c8 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 6 Nov 2021 19:45:19 +0700 Subject: Trim the stack trace --- crypto/src/asn1/DefiniteLengthInputStream.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/src') diff --git a/crypto/src/asn1/DefiniteLengthInputStream.cs b/crypto/src/asn1/DefiniteLengthInputStream.cs index e3b9b5737..0e4d4c41f 100644 --- a/crypto/src/asn1/DefiniteLengthInputStream.cs +++ b/crypto/src/asn1/DefiniteLengthInputStream.cs @@ -86,7 +86,7 @@ namespace Org.BouncyCastle.Asn1 if (_remaining >= limit) throw new IOException("corrupted stream - out of bounds length found: " + _remaining + " >= " + limit); - if ((_remaining -= Streams.ReadFully(_in, buf)) != 0) + if ((_remaining -= Streams.ReadFully(_in, buf, 0, buf.Length)) != 0) throw new EndOfStreamException("DEF length " + _originalLength + " object truncated by " + _remaining); SetParentEofDetect(true); } @@ -102,7 +102,7 @@ namespace Org.BouncyCastle.Asn1 throw new IOException("corrupted stream - out of bounds length found: " + _remaining + " >= " + limit); byte[] bytes = new byte[_remaining]; - if ((_remaining -= Streams.ReadFully(_in, bytes)) != 0) + if ((_remaining -= Streams.ReadFully(_in, bytes, 0, bytes.Length)) != 0) throw new EndOfStreamException("DEF length " + _originalLength + " object truncated by " + _remaining); SetParentEofDetect(true); return bytes; -- cgit 1.5.1