From a9055cab7ac609b96984179194c7a2ec410c8e2b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 13 Nov 2004 03:13:00 +0000 Subject: Update. 2004-11-12 Ulrich Drepper * sysdeps/unix/sysv/linux/libc_fatal.c: Add new function __libc_message which performs the printing and simple format string handling. The string is written to tty, stderr, syslog in this order, stopping after the first successful output. (__libc_fatal): Call __libc_message. * include/stdio.h: Declare __libc_message. * malloc/malloc.c (malloc_printerr): Use __libc_message. * debug/chk_fail.c: Also print message with __libc_message. * debug/test-strcpy_chk.c: Ensure that debug messages are not printed to the terminal or stderr. * debug/tst-chk1.c: Likewise. * posix/Makefile: Remove gpl2lgpl variable. --- debug/chk_fail.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'debug/chk_fail.c') diff --git a/debug/chk_fail.c b/debug/chk_fail.c index 48848fbe35..dc1c3d70b6 100644 --- a/debug/chk_fail.c +++ b/debug/chk_fail.c @@ -1,3 +1,4 @@ + /* Copyright (C) 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,23 +17,14 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include -#include -#include void __attribute__ ((noreturn)) __chk_fail (void) { - while (1) - { - /* This will leave a nice backtrace. */ - abort (); -#ifdef ABORT_INSTRUCTION - ABORT_INSTRUCTION; -#endif - _exit (127); - } + __libc_fatal ("*** buffer overflow detected ***\n"); } libc_hidden_def (__chk_fail) -- cgit 1.4.1