File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed
uefi-test-runner/examples Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,9 @@ impl Buffer {
48
48
}
49
49
50
50
/// Blit the buffer to the framebuffer.
51
- fn blit ( & self , gop : & mut GraphicsOutput ) -> Result {
51
+ fn blit ( & mut self , gop : & mut GraphicsOutput ) -> Result {
52
52
gop. blt ( BltOp :: BufferToVideo {
53
- buffer : & self . pixels ,
53
+ buffer : & mut self . pixels ,
54
54
src : BltRegion :: Full ,
55
55
dest : ( 0 , 0 ) ,
56
56
dims : ( self . width , self . height ) ,
@@ -59,12 +59,12 @@ impl Buffer {
59
59
60
60
/// Update only a pixel to the framebuffer.
61
61
fn blit_pixel (
62
- & self ,
62
+ & mut self ,
63
63
gop : & mut GraphicsOutput ,
64
64
coords : ( usize , usize ) ,
65
65
) -> Result {
66
66
gop. blt ( BltOp :: BufferToVideo {
67
- buffer : & self . pixels ,
67
+ buffer : & mut self . pixels ,
68
68
src : BltRegion :: SubRectangle {
69
69
coords,
70
70
px_stride : self . width ,
Original file line number Diff line number Diff line change 23
23
image in QEMU or Cloud Hypervisor, when the debugcon/debug-console device is
24
24
available.
25
25
- The documentation for UEFI protocols has been streamlined and improved.
26
+ - Fixed memory safety bug in ` SimpleNetwork::read_nv_data ` . The ` buffer `
27
+ parameter is now mutable.
28
+ - Fixed memory safety bug in ` GraphicsOutput::blt `
26
29
27
30
# uefi - 0.35.0 (2025-05-04)
28
31
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ impl GraphicsOutput {
201
201
match src_region {
202
202
BltRegion :: Full => ( self . 0 . blt ) (
203
203
& mut self . 0 ,
204
- buffer. as_ptr ( ) as * mut _ ,
204
+ buffer. as_mut_ptr ( ) . cast ( ) ,
205
205
GraphicsOutputBltOperation :: BLT_BUFFER_TO_VIDEO ,
206
206
0 ,
207
207
0 ,
@@ -217,7 +217,7 @@ impl GraphicsOutput {
217
217
px_stride,
218
218
} => ( self . 0 . blt ) (
219
219
& mut self . 0 ,
220
- buffer. as_ptr ( ) as * mut _ ,
220
+ buffer. as_mut_ptr ( ) . cast ( ) ,
221
221
GraphicsOutputBltOperation :: BLT_BUFFER_TO_VIDEO ,
222
222
src_x,
223
223
src_y,
@@ -533,7 +533,7 @@ pub enum BltOp<'buf> {
533
533
/// Delta must be the stride (count of bytes in a row) of the buffer.
534
534
BufferToVideo {
535
535
/// Buffer from which to copy data.
536
- buffer : & ' buf [ BltPixel ] ,
536
+ buffer : & ' buf mut [ BltPixel ] ,
537
537
/// Location of the source rectangle in the user-provided buffer.
538
538
src : BltRegion ,
539
539
/// Coordinates of the destination rectangle, in the frame buffer.
Original file line number Diff line number Diff line change @@ -144,14 +144,14 @@ impl SimpleNetwork {
144
144
145
145
/// Perform read operations on the NVRAM device attached to
146
146
/// a network interface.
147
- pub fn read_nv_data ( & self , offset : usize , buffer : & [ u8 ] ) -> Result {
147
+ pub fn read_nv_data ( & self , offset : usize , buffer : & mut [ u8 ] ) -> Result {
148
148
unsafe {
149
149
( self . 0 . non_volatile_data ) (
150
150
& self . 0 ,
151
151
Boolean :: from ( true ) ,
152
152
offset,
153
153
buffer. len ( ) ,
154
- buffer. as_ptr ( ) as * mut c_void ,
154
+ buffer. as_mut_ptr ( ) . cast ( ) ,
155
155
)
156
156
}
157
157
. to_result ( )
You can’t perform that action at this time.
0 commit comments