Fix two issues in Marshal.SecureStringToBSTR (#18851)
authorStephen Toub <stoub@microsoft.com>
Tue, 10 Jul 2018 20:02:06 +0000 (16:02 -0400)
committerGitHub <noreply@github.com>
Tue, 10 Jul 2018 20:02:06 +0000 (16:02 -0400)
commitcb005bd771122d919587c646aaebfce7176b36db
treede94533e0eee081870d7632025c4347897ebb906
parent75c64dc83879c87ff0a170eced907f7ed2b8fbd5
Fix two issues in Marshal.SecureStringToBSTR (#18851)

1. It wasn't synchronized, even though other operations on SecureString are in order to avoid concurrency problems leading to memory corruption issues (and it's synchronized on netfx).

2. It wasn't throwing an ObjectDisposedException if the instance was disposed.
src/System.Private.CoreLib/shared/System/Security/SecureString.Unix.cs
src/System.Private.CoreLib/shared/System/Security/SecureString.Windows.cs
src/System.Private.CoreLib/shared/System/Security/SecureString.cs