Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Management uses in-place string modification in interop #28202

Closed
jkoritzinsky opened this issue Dec 13, 2018 · 0 comments
Closed

System.Management uses in-place string modification in interop #28202

jkoritzinsky opened this issue Dec 13, 2018 · 0 comments

Comments

@jkoritzinsky
Copy link
Member

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.

See dotnet/coreclr#21513
cc: @AaronRobinsonMSFT, @janvorli

@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 3.0 milestone Feb 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants