]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Use strcmp16 for cpio sorting
authorJan Janssen <medhefgo@web.de>
Thu, 26 May 2022 07:36:30 +0000 (09:36 +0200)
committerJan Janssen <medhefgo@web.de>
Tue, 31 May 2022 13:09:10 +0000 (15:09 +0200)
src/boot/efi/boot.c
src/boot/efi/cpio.c
src/boot/efi/util.h

index 9a4dda5dd721a86c6e5a606c33769bd121ca2210..68e3e7049cd38c5a5ea5bf37e9140385d371a71f 100644 (file)
@@ -1656,8 +1656,8 @@ static void config_load_entries(
         }
 }
 
-static INTN config_entry_compare(const ConfigEntry *a, const ConfigEntry *b) {
-        INTN r;
+static int config_entry_compare(const ConfigEntry *a, const ConfigEntry *b) {
+        int r;
 
         assert(a);
         assert(b);
index 5de124f113786010bd70fef4afcb861da053d9a6..13da1ca0f85b081fd1e7011b8e9bad61cf9de4dc 100644 (file)
@@ -418,7 +418,7 @@ EFI_STATUS pack_cpio(
 
         /* Now, sort the files we found, to make this uniform and stable (and to ensure the TPM measurements
          * are not dependent on read order) */
-        sort_pointer_array((void**) items, n_items, (compare_pointer_func_t) StrCmp);
+        sort_pointer_array((void**) items, n_items, (compare_pointer_func_t) strcmp16);
 
         /* Generate the leading directory inodes right before adding the first files, to the
          * archive. Otherwise the cpio archive cannot be unpacked, since the leading dirs won't exist. */
index 277ae9bcebdf7071045de31f29fe158f7fa42939..57efd692d1aaa9d14719d0d568e4ac5df3e59df9 100644 (file)
@@ -113,7 +113,7 @@ EFI_STATUS log_oom(void);
 void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str);
 void clear_screen(UINTN attr);
 
-typedef INTN (*compare_pointer_func_t)(const void *a, const void *b);
+typedef int (*compare_pointer_func_t)(const void *a, const void *b);
 void sort_pointer_array(void **array, UINTN n_members, compare_pointer_func_t compare);
 
 EFI_STATUS get_file_info_harder(EFI_FILE *handle, EFI_FILE_INFO **ret, UINTN *ret_size);