public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Various qsort fixes
@ 2023-11-17 18:44 Florian Weimer
  2023-11-17 18:44 ` [PATCH 1/3] stdlib: Avoid another self-comparison in qsort Florian Weimer
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Florian Weimer @ 2023-11-17 18:44 UTC (permalink / raw)
  To: libc-alpha

The first patch is basically a repost, with the condition tweaked for
consistency with the other self-comparison avoidance we have.

The second patch addresses Stepan's observation regarding incorrect
node-index computation in the fallback heapsort heapsort implementation.

The third patch activates the heapsort fallback in more cases, to avoid
denial-of-service issues.

Thanks,
Florian

Florian Weimer (3):
  stdlib: Avoid another self-comparison in qsort
  stdlib: Handle various corner cases in the fallback heapsort for qsort
  stdlib: The qsort implementation needs to use heapsort in more cases

 stdlib/Makefile     |   4 ++
 stdlib/qsort.c      |  74 +++++++++++++------
 stdlib/tst-qsort4.c | 134 ++++++++++++++++++++++++++++++++++
 stdlib/tst-qsort5.c | 171 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 361 insertions(+), 22 deletions(-)
 create mode 100644 stdlib/tst-qsort4.c
 create mode 100644 stdlib/tst-qsort5.c


base-commit: dae3cf4134d476a4b4ef86fd7012231d6436c15e
-- 
2.41.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-20 20:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17 18:44 [PATCH 0/3] Various qsort fixes Florian Weimer
2023-11-17 18:44 ` [PATCH 1/3] stdlib: Avoid another self-comparison in qsort Florian Weimer
2023-11-20 19:05   ` Adhemerval Zanella Netto
2023-11-17 18:44 ` [PATCH 2/3] stdlib: Handle various corner cases in the fallback heapsort for qsort Florian Weimer
2023-11-20 20:02   ` Adhemerval Zanella Netto
2023-11-17 18:44 ` [PATCH 3/3] stdlib: The qsort implementation needs to use heapsort in more cases Florian Weimer
2023-11-20 20:32   ` Adhemerval Zanella Netto
2023-11-20 14:15 ` [PATCH 0/3] Various qsort fixes Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).