Conversation
… use-after-free issues in a debugger on Windows
| { | ||
| void * ptr; | ||
| size_t originalSize; | ||
| size_t size; |
There was a problem hiding this comment.
Optional: If I understand the MSDN pages for VirtualAlloc() and VirtualProtect() correctly, we can just pass the original size to these two functions and they will round the size up to the next page boundary for us.
wantehchang
left a comment
There was a problem hiding this comment.
Joe:
This PR is not needed if AddressSanitizer is available. I just installed Visual Studio 2019 Community Edition on a new Windows 10 computer last weekend, and I saw AddressSanitizer in the installer. Here is the MSDN page:
https://docs.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-160
I will let you decide if you want to merge this PR.
|
This PR can sit for a while. I'd want to make sure I could catch #736 in the debugger when using this VS feature first. One advantage of this PR is it doesn't require any special VS magic; simply building against the Win32 API and it busts in the right spot. |

This is a low priority PR, but this was how I successfully reproduced PR #736 in a debugger, so I figured it would be good to have it checked-in, in case we need to repro use-after-free issues in the future.