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> |
||
|---|---|---|
| .. | ||
| htl | ||
| hurd | ||
| i386 | ||
| include | ||
| sys | ||
| x86 | ||
| x86_64 | ||
| Makefile | ||
| Subdirs | ||
| _strerror.c | ||
| adjtime.c | ||
| clock_gettime.c | ||
| clock_nanosleep.c | ||
| configure | ||
| configure.ac | ||
| getloadavg.c | ||
| getpagesize.c | ||
| getsysstats.c | ||
| libc-lock.h | ||
| libmachuser.abilist | ||
| mach_rpc.h | ||
| mprotect.c | ||
| msync.c | ||
| munmap.c | ||
| pagecopy.h | ||
| readonly-area-fallback.c | ||
| sched_yield.c | ||
| sleep.c | ||
| strerror_l.c | ||
| sysdep.h | ||
| thread_state.h | ||
| usleep.c | ||
| xpg-strerror.c | ||