OSDN Git Service

Make the optional_data_len size signed.
authorPeter Jones <pjones@redhat.com>
Tue, 16 Dec 2014 14:57:27 +0000 (09:57 -0500)
committerPeter Jones <pjones@redhat.com>
Tue, 16 Dec 2014 14:57:27 +0000 (09:57 -0500)
Steve McIntyre's testing on i386 with efivars using the legacy path
(i.e. not efivarfs) also found a bug here - we're checking
optional_data_len for negative error values, but it's unsigned.  We're
not going to have 4GB of optional loader data, so just make it signed.

This should fix Issue #21 .

Signed-off-by: Peter Jones <pjones@redhat.com>
src/efibootmgr/efibootmgr.c

index f9d915b..8460ee1 100644 (file)
@@ -778,7 +778,7 @@ show_boot_vars()
        char description[80];
        EFI_LOAD_OPTION *load_option;
        EFI_DEVICE_PATH *path;
-       unsigned long optional_data_len=0;
+       long optional_data_len=0;
 
        list_for_each(pos, &boot_entry_list) {
                boot = list_entry(pos, var_entry_t, list);