+ /* If If a random generator can't be used, the protector switches the guard
+ to the "terminator canary" */
+ ((unsigned char *)__stack_chk_guard)[0] = 0;
+ ((unsigned char *)__stack_chk_guard)[1] = 0;
+ ((unsigned char *)__stack_chk_guard)[2] = '\n';
+ ((unsigned char *)__stack_chk_guard)[3] = 255;
+}
+
+static const char *stackoverflow_msg = "stack buffer overflow";
+
+void
+__stack_chk_fail()
+{
+ CRSetCrashLogMessage(stackoverflow_msg);
+
+ /* This may fail on a chroot jail... */
+ char prog[2*MAXCOMLEN+1] = {0};
+ proc_name(getpid(), prog, 2*MAXCOMLEN);
+ prog[2*MAXCOMLEN] = 0;
+ _simple_asl_log_prog(ASL_LEVEL_CRIT, "user", stackoverflow_msg, prog);