__stack_chk_fail.c 365 B

123456789101112131415161718
  1. #include <string.h>
  2. #include <stdint.h>
  3. #include "pthread_impl.h"
  4. uintptr_t __stack_chk_guard;
  5. void __init_ssp(void *entropy)
  6. {
  7. if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t));
  8. else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245;
  9. __pthread_self()->canary = __stack_chk_guard;
  10. }
  11. void __stack_chk_fail(void)
  12. {
  13. a_crash();
  14. }