mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
stdlib: assert on NULL function pointer in atexit etc. [BZ #20544]
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "exit.h"
|
||||
#include <sysdep.h>
|
||||
@ -25,6 +26,10 @@ __on_exit (void (*func) (int status, void *arg), void *arg)
|
||||
{
|
||||
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 (&__exit_funcs);
|
||||
|
||||
|
Reference in New Issue
Block a user