Created
August 16, 2024 13:50
-
-
Save WindyNova/2867d58404073f924f8157a5b8806875 to your computer and use it in GitHub Desktop.
Use-After-Free demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main() { | |
| int* ptr = new int; | |
| *ptr = 10; | |
| delete ptr; | |
| std::cout << *ptr << std::endl; // UAF | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment