Skip to content

Commit

Permalink
Merge pull request #1550 from nicholasbishop/bishop-fix-snp-len
Browse files Browse the repository at this point in the history
uefi: Fix the BufferSize argument in SimpleNetwork::transmit
  • Loading branch information
phip1611 authored Feb 17, 2025
2 parents fd72002 + 86c8039 commit 470a1ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions uefi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- `boot::memory_map()` will never return `Status::BUFFER_TOO_SMALL` from now on,
as this is considered a hard internal error where users can't do anything
about it anyway. It will panic instead.
- `SimpleNetwork::transmit` now passes the correct buffer size argument.
Previously it incorrectly added the header size to the buffer length, which
could cause the firmware to read past the end of the buffer.


# uefi - 0.34.1 (2025-02-07)
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/network/snp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl SimpleNetwork {
(self.transmit)(
self,
header_size,
buffer.len() + header_size,
buffer.len(),
buffer.as_ptr().cast(),
src_addr.as_ref(),
dest_addr.as_ref(),
Expand Down

0 comments on commit 470a1ed

Please sign in to comment.