Skip to content

Properly handle allocation failure #90

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

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

josephlr
Copy link
Contributor

@josephlr josephlr commented Feb 6, 2019

The change in #89 did not properly handle allocation failures. On
failure, alloc() returns a null pointer, and this is not checked.

This change moves buffer allocation to the new Alloc API, and correctly
handles allocation failure and potential unsafety with zero-sized alloc
requests.

I also removed the dependency on uefi-services from uefi-alloc. The
dependency isn't needed, and now users can use uefi-exts with their
own allocators.

The change in rust-osdev#89 did not properly handle allocation failures. On
failure, alloc() returns a null pointer, and this is not checked.

This change moves buffer allocation to the new Alloc API, correctly
handles allocation failure, and avoids potential unsafety with
zero-sized alloc requests.

I also removed the dependancy on uefi-services from uefi-alloc. The
dependancy isn't needed, and now users can use uefi-exts with their
own allocators.
@josephlr josephlr force-pushed the master branch 2 times, most recently from 471a46a to 4adedd6 Compare February 6, 2019 09:19
@GabrielMajeri
Copy link
Collaborator

Looks like a great change, thank you

@GabrielMajeri GabrielMajeri merged commit 02616ac into rust-osdev:master Feb 6, 2019
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.

2 participants