You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working to block users from intentionally using interop to modify the internal buffer of a string to avoid corrupting interned strings and crashing during ALC unloading, I discovered that the IWbemPath interface in System.Management's GetPath_ method has a [In][Out][MarshalAs(UnmanagedType.LPWStr)] string path parameter that modifies the string value in-place. We should change this to use an [In][Out][MarshalAs(UnmanagedType.LPWStr)] StringBuilder path parameter so we aren't modifying a strings internal buffer from native code.
While working to block users from intentionally using interop to modify the internal buffer of a
string
to avoid corrupting interned strings and crashing during ALC unloading, I discovered that theIWbemPath
interface inSystem.Management
'sGetPath_
method has a[In][Out][MarshalAs(UnmanagedType.LPWStr)] string path
parameter that modifies the string value in-place. We should change this to use an[In][Out][MarshalAs(UnmanagedType.LPWStr)] StringBuilder path
parameter so we aren't modifying astring
s internal buffer from native code.See dotnet/coreclr#21513
cc: @AaronRobinsonMSFT, @janvorli
The text was updated successfully, but these errors were encountered: