diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-06 19:45:19 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-06 19:45:19 +0700 |
commit | 02581a8b87b9b5d2629ae9f2bc5439caafe1e8c8 (patch) | |
tree | 0c89a0a345e53d4343b5d94163834222ad79ff88 /crypto/src/asn1 | |
parent | Add TagClass property to Asn1TaggedObject (diff) | |
download | BouncyCastle.NET-ed25519-02581a8b87b9b5d2629ae9f2bc5439caafe1e8c8.tar.xz |
Trim the stack trace
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r-- | crypto/src/asn1/DefiniteLengthInputStream.cs | 4 |
1 files changed, 2 insertions, 2 deletions
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; |