mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-06-12 14:05:39 +00:00
Exit our dir->Read() loop if it says there's 0 bytes of data to read.
When dir->Read() says bs=0, we shouldn't try to allocate a buffer and read into it. On edk2 this works because there's an implicit (possibly accidental) minimum size of one pool list entry that can be allocated, so you wind up getting (I think) 8 bytes. When Rob Clark tried to run this under uboot's emulated UEFI environment, dir->Read() returned 0 and when we passed that to AllocateZeroPool() less good things happened. So just check for that case and exit appropriately. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
c4aa058c2b
commit
d89b722ef7
@ -591,6 +591,10 @@ find_boot_csv(EFI_FILE_HANDLE fh, CHAR16 *dirname)
|
||||
FreePool(buffer);
|
||||
return rc;
|
||||
}
|
||||
/* If there's no data to read, don't try to allocate 0 bytes
|
||||
* and read the data... */
|
||||
if (bs == 0)
|
||||
break;
|
||||
|
||||
buffer = AllocateZeroPool(bs);
|
||||
if (!buffer) {
|
||||
|
Loading…
Reference in New Issue
Block a user