diff options
author | 2023-11-21 16:45:35 +0100 | |
---|---|---|
committer | 2023-11-21 16:46:18 +0100 | |
commit | 64e4acf24da15c11cb83f933947df3b2e8a700cd (patch) | |
tree | b3d8e27747379f2b9e4007740f706a63225387f5 /stdio-common/_itoa.c | |
parent | stdlib: Handle various corner cases in the fallback heapsort for qsort (diff) | |
download | glibc-64e4acf24da15c11cb83f933947df3b2e8a700cd.tar.xz glibc-64e4acf24da15c11cb83f933947df3b2e8a700cd.zip |
stdlib: The qsort implementation needs to use heapsort in more cases
The existing logic avoided internal stack overflow. To avoid
a denial-of-service condition with adversarial input, it is necessary
to fall over to heapsort if tail-recursing deeply, too, which does
not result in a deep stack of pending partitions.
The new test stdlib/tst-qsort5 is based on Douglas McIlroy's paper
on this subject.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'stdio-common/_itoa.c')
0 files changed, 0 insertions, 0 deletions