diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2018-09-01 10:50:41 -0700 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2018-11-30 16:18:34 -0800 |
commit | 8e67b39eb4a3abb6f3e35de3ad6e5d06ed0e8498 (patch) | |
tree | 32cb45ac608306b882ba1dab40756ea9eafc12d8 /stdlib/cxa_atexit.c | |
parent | 15b8d67e29142251a30576b5ab469051a8833e97 (diff) | |
download | glibc-8e67b39eb4a3abb6f3e35de3ad6e5d06ed0e8498.tar.gz glibc-8e67b39eb4a3abb6f3e35de3ad6e5d06ed0e8498.tar.xz glibc-8e67b39eb4a3abb6f3e35de3ad6e5d06ed0e8498.zip |
stdlib: assert on NULL function pointer in atexit etc. [BZ #20544]
Diffstat (limited to 'stdlib/cxa_atexit.c')
-rw-r--r-- | stdlib/cxa_atexit.c | 4 |
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); |