77//! functions after exiting boot services; see the "Calling Convention" section
88//! of the UEFI specification for details.
99
10- use alloc:: vec;
1110use crate :: data_types:: PhysicalAddress ;
1211use crate :: table:: { self , Revision } ;
1312use crate :: { CStr16 , Error , Result , Status , StatusExt } ;
@@ -18,7 +17,7 @@ use uefi_raw::table::boot::MemoryDescriptor;
1817#[ cfg( feature = "alloc" ) ]
1918use {
2019 crate :: mem:: make_boxed, crate :: CString16 , crate :: Guid , alloc:: borrow:: ToOwned ,
21- alloc:: boxed:: Box , alloc:: vec:: Vec ,
20+ alloc:: boxed:: Box , alloc:: { vec, vec :: Vec }
2221} ;
2322
2423#[ cfg( all( feature = "unstable" , feature = "alloc" ) ) ]
@@ -269,12 +268,14 @@ pub struct VariableKeys {
269268#[ cfg( feature = "alloc" ) ]
270269impl VariableKeys {
271270 fn new ( ) -> Self {
272- // Create a the name buffer with a reasonable default capacity, and
273- // initialize it to an empty null-terminated string.
274- let name = vec ! [ 0 ; 512 ] ;
271+ // Create a name buffer with a large default size and zero
272+ // initialize it. A Toshiba Satellite Pro R50-B-12P was found
273+ // to not correctly update the VariableNameSize passed into
274+ // GetNextVariableName and starting with a large buffer works
275+ // around this issue.
276+ let name = vec ! [ 0 ; 512 ] ;
275277
276278 Self {
277- // Give the name buffer a reasonable default capacity.
278279 name,
279280 // The initial vendor GUID is arbitrary.
280281 vendor : VariableVendor ( Guid :: default ( ) ) ,
0 commit comments