Fix a use after free for Managed Data BP (dotnet/coreclr#21205)
authorChuck Ries <chuckr@microsoft.com>
Tue, 27 Nov 2018 06:06:34 +0000 (22:06 -0800)
committerAndrew Au <cshung@gmail.com>
Tue, 27 Nov 2018 06:06:34 +0000 (22:06 -0800)
commit2e084370ab67e0ed38d7d7b28cdeb3855a0a12fc
treed595e4441009da343379a68dd023dd6cfa967151
parenteec801596f5d48066babacbc9d7e4b6d5e9b6fde
Fix a use after free for Managed Data BP (dotnet/coreclr#21205)

ShimProxyCallback::DataBreakpoint::DataBreakpointEvent was holding onto a bare
BYTE* for the CONTEXT rather than copying the buffer and taking ownership. Due to
lifetime, this resulted in a use after free. Apparently in retail code we got lucky
and this worked enough of the time that we never noticed it.

Commit migrated from https://github.com/dotnet/coreclr/commit/870267fac0b16ac246d6ba01f49ba4c6acd2319c
src/coreclr/src/debug/di/shimcallback.cpp