mirror of git://sourceware.org/git/glibc.git
If the input buffer exceeds the stack auxiliary buffer, qsort will malloc a temporary one to call mergesort. Since C++ standard does allow the callback comparison function to throw [1], the glibc implementation can potentially leak memory. The fixes uses a pthread_cleanup_combined_push and pthread_cleanup_combined_pop, so it can work with and without exception enables. The qsort code path that calls malloc now requires some extra setup and a call to __pthread_cleanup_push anmd __pthread_cleanup_pop (which should be ok since they just setup some buffer state). Checked on x86_64-linux-gnu. [1] https://timsong-cpp.github.io/cppwp/n4950/alg.c.library#4 Reviewed-by: DJ Delorie <dj@redhat.com> |
||
|---|---|---|
| .. | ||
| bits | ||
| sys | ||
| Implies | ||
| Makeconfig | ||
| Makefile | ||
| Subdirs | ||
| _Fork.c | ||
| aio_misc.h | ||
| cancellation-pc-check.h | ||
| dl-mutex.c | ||
| dl-thread_gscope_wait.c | ||
| dl-tls_init_tp.c | ||
| dl-tunables.list | ||
| fork.h | ||
| futex-internal.h | ||
| gai_misc.h | ||
| internaltypes.h | ||
| jmp-unwind.c | ||
| libc-lock.h | ||
| libc-lockP.h | ||
| libc_start_call_main.h | ||
| lowlevellock-futex.h | ||
| lowlevellock.h | ||
| malloc-machine.h | ||
| proc_service.h | ||
| pthread-offsets.h | ||
| pthread.h | ||
| pthreadP.h | ||
| pthread_atfork_compat.h | ||
| pthread_early_init.h | ||
| pthread_mutex_backoff.h | ||
| pthread_mutex_conf.h | ||
| rseq-access.h | ||
| setxid.h | ||
| stdio-lock.h | ||
| tcb-access.h | ||
| tcb-offsets.h | ||
| thread_db.h | ||
| timer_routines.h | ||
| tst-mqueue8x.c | ||