@@ -16,8 +16,12 @@ use uefi_raw::table::boot::MemoryDescriptor;
1616
1717#[ cfg( feature = "alloc" ) ]
1818use {
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 } ,
2125} ;
2226
2327#[ cfg( all( feature = "unstable" , feature = "alloc" ) ) ]
@@ -268,13 +272,14 @@ pub struct VariableKeys {
268272#[ cfg( feature = "alloc" ) ]
269273impl VariableKeys {
270274 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 ] ;
275281
276282 Self {
277- // Give the name buffer a reasonable default capacity.
278283 name,
279284 // The initial vendor GUID is arbitrary.
280285 vendor : VariableVendor ( Guid :: default ( ) ) ,
0 commit comments