-
Notifications
You must be signed in to change notification settings - Fork 41
patina_dxe_core/fv: Fix test_fv_functionality() panic [Rebase & FF]
#1134
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
patina_dxe_core/fv: Fix test_fv_functionality() panic [Rebase & FF]
#1134
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
6c53ac4 to
9fb2aff
Compare
test_fv_functionality() panictest_fv_functionality() panic [Rebase & FF]
os-d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The first commit message says it isn't going to follow the C behavior because it is unintuitive but then the second commit adds that behavior. May be worth amending the commit message.
That reflects my decision process :). I decided to just get it to match to prevent dealing with some subtle difference in the future. I'll update the commit message. |
Fixes OpenDevicePartnership#1127 Code is currently commented out in `test_fv_functionality()` that calls `fv_read_file()` with a non-null buffer and buffer size of zero. This change updates `fv_read_file()` to follow the same behavior as the C DXE Core `FvReadFile()` function in FwVolRead.c that will return `BUFFER_TOO_SMALL` in this scenario. Another difference in behavior is that if the caller provides a non-null buffer but a buffer size less than the file content size, the C implementation will truncate the copy size to the size provided and perform the copy with that size. That change is made in a separate commit. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Matches the C implementation more closely by performing truncated copies when the provided buffer is too small. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
634b6c3 to
7264ce3
Compare
Description
Fixes #1127
Code is currently commented out in
test_fv_functionality()that callsfv_read_file()with a non-null buffer and buffer size of zero.This change updates
fv_read_file()to follow the same behavior as the C DXE CoreFvReadFile()function in FwVolRead.c that will returnBUFFER_TOO_SMALLin this scenario.Another difference in behavior is that if the caller provides a non-null buffer but a buffer size less than the file content size, the C implementation will truncate the copy size to the size provided and perform the copy with that size. To prevent further discrepancies between caller expectations, that change is made in a second commit.
patina_dxe_core: Truncate copies in fv_read_file()
Matches the C implementation more closely by performing truncated copies
when the provided buffer is too small.
How This Was Tested
cargo make allIntegration Instructions