[PATCH] elf: Fix incorrect comparison in sort_priorities_by_name

Florian Weimer fweimer@redhat.com
Wed Dec 9 18:23:37 GMT 2020


Reported-By: Stefan Liebler <stli@linux.ibm.com>

---
 elf/dl-hwcaps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 5a71f80154..000e3c0eb9 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -153,7 +153,7 @@ sort_priorities_by_name (void)
 	else
 	  to_compare = previous->name_length;
 	int cmp = memcmp (current->name, previous->name, to_compare);
-	if (cmp >= 0
+	if (cmp > 0
 	    || (cmp == 0 && current->name_length >= previous->name_length))
 	  break;
 

-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill



More information about the Libc-alpha mailing list