mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
libksba: fix qsort handler to sort the string table in a reproducible way
Signed-off-by: Trammell Hudson <hudson@trmm.net>
This commit is contained in:
parent
8af849cadc
commit
69f3cc46ab
20
patches/libkbsa-1.3.5.patch
Normal file
20
patches/libkbsa-1.3.5.patch
Normal file
@ -0,0 +1,20 @@
|
||||
--- clean/libksba-1.3.5/src/asn1-gentables.c 2016-08-22 11:38:21.000000000 +0200
|
||||
+++ libksba-1.3.5/src/asn1-gentables.c 2020-01-07 18:56:03.658790390 +0100
|
||||
@@ -112,7 +112,16 @@
|
||||
const struct name_list_s **a = (const struct name_list_s **)aptr;
|
||||
const struct name_list_s **b = (const struct name_list_s **)bptr;
|
||||
|
||||
- return strlen ((*a)->name) < strlen ((*b)->name);
|
||||
+ const size_t len_a = strlen((*a)->name);
|
||||
+ const size_t len_b = strlen((*b)->name);
|
||||
+
|
||||
+ if (len_a == len_b)
|
||||
+ return strcmp((*a)->name, (*b)->name);
|
||||
+ else
|
||||
+ if (len_a < len_b)
|
||||
+ return -1;
|
||||
+ else
|
||||
+ return +1;
|
||||
}
|
||||
|
||||
static void
|
Loading…
Reference in New Issue
Block a user