/* Note how buffer overruns are undefined behavior and the compilers tend to optimize these checks away if you wrote them yourself, this only works robustly because the compiler did it itself. */ extern uintptr_t __stack_chk_guard; noreturn void __stack_chk_fail(void); void foo(const char* str) { uintptr_t canary = __stack_chk_guard; char buffer[16]; strcpy(buffer, str); if ( (canary = canary ^ __