projects
/
glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88892b4
)
local-qsort-memory-corruption
author
GNU Libc Maintainers
<debian-glibc@lists.debian.org>
Wed, 7 Feb 2024 18:25:17 +0000
(18:25 +0000)
committer
Raspbian forward porter
<root@raspbian.org>
Wed, 7 Feb 2024 18:25:17 +0000
(18:25 +0000)
Gbp-Pq: Topic any
Gbp-Pq: Name local-qsort-memory-corruption.patch
stdlib/qsort.c
patch
|
blob
|
history
diff --git
a/stdlib/qsort.c
b/stdlib/qsort.c
index 728a0ed370e00a76bdd22c3317a75b9be6736f48..b11ad3a87101f242f59656acb35d6d54e1f5253e 100644
(file)
--- a/
stdlib/qsort.c
+++ b/
stdlib/qsort.c
@@
-224,7
+224,8
@@
_quicksort (void *const pbase, size_t total_elems, size_t size,
while ((run_ptr += size) <= end_ptr)
{
tmp_ptr = run_ptr - size;
- while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, arg) < 0)
+ while (tmp_ptr != base_ptr
+ && (*cmp) ((void *) run_ptr, (void *) tmp_ptr, arg) < 0)
tmp_ptr -= size;
tmp_ptr += size;