Skip to content

Commit 63ded99

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 63ded99

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
@@ -10,6 +10,7 @@
1010
use crate::data_types::PhysicalAddress;
1111
use crate::table::{self, Revision};
1212
use crate::{CStr16, Error, Result, Status, StatusExt};
13+
use core::alloc::vec;
1314
use core::fmt::{self, Debug, Display, Formatter};
1415
use core::ptr::{self, NonNull};
1516
use uefi_raw::table::boot::MemoryDescriptor;
@@ -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)