Skip to content

Commit 7385a2f

Browse files
committed
uefi runtime: Increase default size of name buffer
Some firmware fails to update the "VariableNameSize" parameter passed into GetNextVariableName(). To work around this we will use a large default buffer size.
1 parent 83f11ca commit 7385a2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uefi/src/runtime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//! functions after exiting boot services; see the "Calling Convention" section
88
//! of the UEFI specification for details.
99
10+
use alloc::vec;
1011
use crate::data_types::PhysicalAddress;
1112
use crate::table::{self, Revision};
1213
use crate::{CStr16, Error, Result, Status, StatusExt};
@@ -270,8 +271,7 @@ impl VariableKeys {
270271
fn new() -> Self {
271272
// Create a the name buffer with a reasonable default capacity, and
272273
// initialize it to an empty null-terminated string.
273-
let mut name = Vec::with_capacity(32);
274-
name.push(0);
274+
let name = vec![0;512];
275275

276276
Self {
277277
// Give the name buffer a reasonable default capacity.

0 commit comments

Comments
 (0)