Skip to content

Commit 470a1ed

Browse files
authored
Merge pull request #1550 from nicholasbishop/bishop-fix-snp-len
uefi: Fix the BufferSize argument in SimpleNetwork::transmit
2 parents fd72002 + 86c8039 commit 470a1ed

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: uefi/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
- `boot::memory_map()` will never return `Status::BUFFER_TOO_SMALL` from now on,
88
as this is considered a hard internal error where users can't do anything
99
about it anyway. It will panic instead.
10+
- `SimpleNetwork::transmit` now passes the correct buffer size argument.
11+
Previously it incorrectly added the header size to the buffer length, which
12+
could cause the firmware to read past the end of the buffer.
1013

1114

1215
# uefi - 0.34.1 (2025-02-07)

Diff for: uefi/src/proto/network/snp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl SimpleNetwork {
225225
(self.transmit)(
226226
self,
227227
header_size,
228-
buffer.len() + header_size,
228+
buffer.len(),
229229
buffer.as_ptr().cast(),
230230
src_addr.as_ref(),
231231
dest_addr.as_ref(),

0 commit comments

Comments
 (0)