about summary refs log tree commit diff
path: root/stdlib/cxa_atexit.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/cxa_atexit.c')
-rw-r--r--stdlib/cxa_atexit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/cxa_atexit.c b/stdlib/cxa_atexit.c
index 6d65f7e615..37b22d5801 100644
--- a/stdlib/cxa_atexit.c
+++ b/stdlib/cxa_atexit.c
@@ -36,6 +36,10 @@ __internal_atexit (void (*func) (void *), void *arg, void *d,
 {
   struct exit_function *new;
 
+  /* As a QoI issue we detect NULL early with an assertion instead
+     of a SIGSEGV at program exit when the handler is run (bug 20544).  */
+  assert (func != NULL);
+
   __libc_lock_lock (__exit_funcs_lock);
   new = __new_exitfn (listp);