Created
October 12, 2020 21:20
-
-
Save kybr/528bd203a474aba20ac4545231f0bc10 to your computer and use it in GitHub Desktop.
This file contains 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 <chrono> | |
#include <iostream> | |
#include <thread> | |
int main() { | |
std::thread t([]() { | |
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); | |
char* t = nullptr; | |
t[-1] = 1; // crash, please | |
}); | |
getchar(); | |
t.join(); | |
} | |
// '...' terminated by signal SIGSEGV (Address boundary error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment