@@ -16,8 +16,12 @@ use uefi_raw::table::boot::MemoryDescriptor;
16
16
17
17
#[ cfg( feature = "alloc" ) ]
18
18
use {
19
- crate :: mem:: make_boxed, crate :: CString16 , crate :: Guid , alloc:: borrow:: ToOwned ,
20
- alloc:: boxed:: Box , alloc:: vec:: Vec ,
19
+ crate :: mem:: make_boxed,
20
+ crate :: CString16 ,
21
+ crate :: Guid ,
22
+ alloc:: borrow:: ToOwned ,
23
+ alloc:: boxed:: Box ,
24
+ alloc:: { vec, vec:: Vec } ,
21
25
} ;
22
26
23
27
#[ cfg( all( feature = "unstable" , feature = "alloc" ) ) ]
@@ -268,13 +272,14 @@ pub struct VariableKeys {
268
272
#[ cfg( feature = "alloc" ) ]
269
273
impl VariableKeys {
270
274
fn new ( ) -> Self {
271
- // Create a the name buffer with a reasonable default capacity, and
272
- // initialize it to an empty null-terminated string.
273
- let mut name = Vec :: with_capacity ( 32 ) ;
274
- name. push ( 0 ) ;
275
+ // Create a name buffer with a large default size and zero
276
+ // initialize it. A Toshiba Satellite Pro R50-B-12P was found
277
+ // to not correctly update the VariableNameSize passed into
278
+ // GetNextVariableName and starting with a large buffer works
279
+ // around this issue.
280
+ let name = vec ! [ 0 ; 512 ] ;
275
281
276
282
Self {
277
- // Give the name buffer a reasonable default capacity.
278
283
name,
279
284
// The initial vendor GUID is arbitrary.
280
285
vendor : VariableVendor ( Guid :: default ( ) ) ,
0 commit comments