mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-10-04 20:59:04 +00:00
Fix format strings for 32-bit builds
This commit is contained in:
parent
e4de724317
commit
c8efa9abf7
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -8,6 +8,7 @@ shim (15.5-1) UNRELEASED; urgency=medium
|
|||||||
- fix-import_one_mok_state.patch
|
- fix-import_one_mok_state.patch
|
||||||
- fix_arm64_rela_sections.patch
|
- fix_arm64_rela_sections.patch
|
||||||
- relax_check_for_import_mok_state.patch
|
- relax_check_for_import_mok_state.patch
|
||||||
|
* Fix format strings for 32-bit builds
|
||||||
* Tweak setup for dh_auto_test so the tests work
|
* Tweak setup for dh_auto_test so the tests work
|
||||||
* Add new build-dep on libefivar-dev for tests
|
* Add new build-dep on libefivar-dev for tests
|
||||||
|
|
||||||
|
45
debian/patches/fix-32b-format-strings.patch
vendored
Normal file
45
debian/patches/fix-32b-format-strings.patch
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
diff --git a/post-process-pe.c b/post-process-pe.c
|
||||||
|
index 8414a5fa..7efba714 100644
|
||||||
|
--- a/post-process-pe.c
|
||||||
|
+++ b/post-process-pe.c
|
||||||
|
@@ -174,7 +174,7 @@ load_pe(const char *const file, void *const data, const size_t datasize,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FileAlignment % 2 != 0)
|
||||||
|
- errx(1, "%s: Invalid file alignment %ld", file, FileAlignment);
|
||||||
|
+ errx(1, "%s: Invalid file alignment %ld", file, (long)FileAlignment);
|
||||||
|
|
||||||
|
if (FileAlignment == 0)
|
||||||
|
FileAlignment = 0x200;
|
||||||
|
@@ -189,7 +189,7 @@ load_pe(const char *const file, void *const data, const size_t datasize,
|
||||||
|
"Number of RVAs:%"PRIu64" EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES:%d\n",
|
||||||
|
ctx->NumberOfRvaAndSizes, EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES);
|
||||||
|
if (EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES < ctx->NumberOfRvaAndSizes)
|
||||||
|
- errx(1, "%s: invalid number of RVAs (%lu entries, max is %d)",
|
||||||
|
+ errx(1, "%s: invalid number of RVAs (%llu entries, max is %d)",
|
||||||
|
file, ctx->NumberOfRvaAndSizes,
|
||||||
|
EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES);
|
||||||
|
|
||||||
|
@@ -234,11 +234,11 @@ load_pe(const char *const file, void *const data, const size_t datasize,
|
||||||
|
sizeof(EFI_IMAGE_DATA_DIRECTORY), &sz1))
|
||||||
|
debug(ERROR,
|
||||||
|
"ctx->NumberOfRvaAndSizes (%zu) * sizeof(EFI_IMAGE_DATA_DIRECTORY) overflows\n",
|
||||||
|
- ctx->NumberOfRvaAndSizes);
|
||||||
|
+ (size_t)ctx->NumberOfRvaAndSizes);
|
||||||
|
else
|
||||||
|
debug(ERROR,
|
||||||
|
"ctx->NumberOfRvaAndSizes (%zu) * sizeof(EFI_IMAGE_DATA_DIRECTORY) = %zu\n",
|
||||||
|
- ctx->NumberOfRvaAndSizes, sz1);
|
||||||
|
+ (size_t)ctx->NumberOfRvaAndSizes, sz1);
|
||||||
|
debug(ERROR,
|
||||||
|
"space after image header:%zu data directory size:%zu\n",
|
||||||
|
sz0, sz1);
|
||||||
|
@@ -271,7 +271,7 @@ load_pe(const char *const file, void *const data, const size_t datasize,
|
||||||
|
if (sub(ctx->SizeOfHeaders, SectionHeaderOffset, &sz0) ||
|
||||||
|
div(sz0, EFI_IMAGE_SIZEOF_SECTION_HEADER, &sz0) ||
|
||||||
|
(sz0 < ctx->NumberOfSections)) {
|
||||||
|
- debug(ERROR, "(%zu - %zu) / %d >= %d\n", ctx->SizeOfHeaders,
|
||||||
|
+ debug(ERROR, "(%zu - %zu) / %d >= %d\n", (size_t)ctx->SizeOfHeaders,
|
||||||
|
SectionHeaderOffset, EFI_IMAGE_SIZEOF_SECTION_HEADER,
|
||||||
|
ctx->NumberOfSections);
|
||||||
|
errx(1, "%s: image sections overflow section headers", file);
|
1
debian/patches/series
vendored
1
debian/patches/series
vendored
@ -1 +1,2 @@
|
|||||||
fix-test-includes.patch
|
fix-test-includes.patch
|
||||||
|
fix-32b-format-strings.patch
|
||||||
|
Loading…
Reference in New Issue
Block a user