aboutsummaryrefslogtreecommitdiff
path: root/setjmp/setjmp.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-05-15 19:28:04 -0700
committerUlrich Drepper <drepper@redhat.com>2009-05-15 19:37:13 -0700
commitb50f8e42ba3010f0141e6a482e0820f658e89b63 (patch)
tree80cef469731d5857499883d45fd3424730f0db7c /setjmp/setjmp.h
parentf1342e0be8e222dbca077beca94b5937564e8c4b (diff)
downloadglibc-b50f8e42ba3010f0141e6a482e0820f658e89b63.zip
glibc-b50f8e42ba3010f0141e6a482e0820f658e89b63.tar.gz
glibc-b50f8e42ba3010f0141e6a482e0820f658e89b63.tar.bz2
Check for valid stack frame in longjmp.
If longjmp restores the stack frame to an address which is beyond the stack frame at the time of the longjmp call it would install an uninitialized stack frame. If compiled with _FORTIFY_SOURCE defined, longjmp will now bail out in this situation.
Diffstat (limited to 'setjmp/setjmp.h')
-rw-r--r--setjmp/setjmp.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h
index 6b1037f..3bc382f 100644
--- a/setjmp/setjmp.h
+++ b/setjmp/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2001, 2002, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999,2001,2002,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -111,6 +111,12 @@ extern void siglongjmp (sigjmp_buf __env, int __val)
__THROW __attribute__ ((__noreturn__));
#endif /* Use POSIX. */
+
+/* Define helper functions to catch unsafe code. */
+#if __USE_FORTIFY_LEVEL > 0
+# include <bits/setjmp2.h>
+#endif
+
__END_DECLS
#endif /* setjmp.h */