blob: ad47bb4a9b3bf5b3c35dffc90d72f717cf8bd48a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <stdint.h>
#include "panic.h"
#if UINT32_MAX == UINTPTR_MAX
#define STACK_CHK_GUARD 0xdeadbeef
#else
#define STACK_CHK_GUARD 0x0ddc0ffeebadf00d
#endif
uintptr_t __stack_chk_guard = STACK_CHK_GUARD;
__attribute__((noreturn)) void __stack_chk_fail(void)
{
#if __STDC_HOSTED__
abort();
#else
panic("Stack smashing detected");
#endif
}
|