Fix two issues in Marshal.SecureStringToBSTR (dotnet/coreclr#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)
commit515b59e6a179125865347eb185025b9d02a8e197
tree5078a8ed6e3ac2326f172d05cd7963b83e3e056e
parentab1e610d4f1891784992a4cc8bed229a98466132
Fix two issues in Marshal.SecureStringToBSTR (dotnet/coreclr#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.

Commit migrated from https://github.com/dotnet/coreclr/commit/cb005bd771122d919587c646aaebfce7176b36db
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Unix.cs
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.cs
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs