elf: Fix incorrect comparison in sort_priorities_by_name

Reported-By: Stefan Liebler <stli@linux.ibm.com>
This commit is contained in:
Florian Weimer 2020-12-09 18:56:14 +01:00
parent f88242af19
commit 0d4ed9d40e

View File

@ -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;