mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-06 10:13:23 +00:00
shim: Extend invalid reloc size warning message
Knowing the value of the reloc directory size is helpful for debugging, cf. issue #131 [1], [1]: https://github.com/rhboot/shim/issues/131 Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Upstream-commit-id: dd3230d07f3
This commit is contained in:
parent
85c837d67f
commit
956717e2b3
10
shim.c
10
shim.c
@ -280,8 +280,14 @@ static EFI_STATUS relocate_coff (PE_COFF_LOADER_IMAGE_CONTEXT *context,
|
||||
while (RelocBase < RelocBaseEnd) {
|
||||
Reloc = (UINT16 *) ((char *) RelocBase + sizeof (EFI_IMAGE_BASE_RELOCATION));
|
||||
|
||||
if ((RelocBase->SizeOfBlock == 0) || (RelocBase->SizeOfBlock > context->RelocDir->Size)) {
|
||||
perror(L"Reloc %d block size %d is invalid\n", n, RelocBase->SizeOfBlock);
|
||||
if (RelocBase->SizeOfBlock == 0) {
|
||||
perror(L"Reloc %d block size 0 is invalid\n", n);
|
||||
return EFI_UNSUPPORTED;
|
||||
} else if (RelocBase->SizeOfBlock > context->RelocDir->Size) {
|
||||
perror(L"Reloc %d block size %d greater than reloc dir"
|
||||
"size %d, which is invalid\n", n,
|
||||
RelocBase->SizeOfBlock,
|
||||
context->RelocDir->Size);
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user