Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback allocation errors #402

Merged
merged 2 commits into from
Sep 3, 2021

Conversation

vathpela
Copy link
Contributor

This fixes two bugs with fallback's read_file() allocation.

xypron and others added 2 commits September 3, 2021 09:46
After calling AllocateZeroPool() we must check the returned pointer.

Fixes: 3ce517f ("Add a fallback loader for when shim is invoked as BOOTX64.EFI")
Signed-off-by: Heinrich Schuchardt <[email protected]>
Heinrich correctly noticed that read_file()'s memory allocation failure
error path tested the wrong variable, and thus would never catch the
error condition.  The *next* error, file->Read() failing, has the same
incorrect variable usage in its FreePool() invocation.

This fixes it to free the right variable as well.

Signed-off-by: Peter Jones <[email protected]>
@frozencemetery frozencemetery force-pushed the fallback-allocation-errors branch from 85292de to cff8db7 Compare September 3, 2021 13:46
@frozencemetery frozencemetery merged commit cff8db7 into rhboot:main Sep 3, 2021
@vathpela vathpela deleted the fallback-allocation-errors branch February 11, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants