From 659eafd2dffa3c1ab2a15b60bac583635b3769cc Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 30 Jun 2022 10:35:12 +0700 Subject: Null tmpBuffers when disposing --- crypto/src/asn1/Asn1InputStream.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crypto/src/asn1/Asn1InputStream.cs b/crypto/src/asn1/Asn1InputStream.cs index 1df6a0206..da6175fcc 100644 --- a/crypto/src/asn1/Asn1InputStream.cs +++ b/crypto/src/asn1/Asn1InputStream.cs @@ -17,7 +17,7 @@ namespace Org.BouncyCastle.Asn1 { private readonly int limit; - internal readonly byte[][] tmpBuffers; + internal byte[][] tmpBuffers; internal static int FindLimit(Stream input) { @@ -67,6 +67,13 @@ namespace Org.BouncyCastle.Asn1 this.tmpBuffers = tmpBuffers; } + protected override void Dispose(bool disposing) + { + tmpBuffers = null; + + base.Dispose(disposing); + } + /** * build an object given its tag and the number of bytes to construct it from. */ -- cgit 1.4.1