7
7
//! functions after exiting boot services; see the "Calling Convention" section
8
8
//! of the UEFI specification for details.
9
9
10
- use alloc:: vec;
11
10
use crate :: data_types:: PhysicalAddress ;
12
11
use crate :: table:: { self , Revision } ;
13
12
use crate :: { CStr16 , Error , Result , Status , StatusExt } ;
@@ -18,7 +17,7 @@ use uefi_raw::table::boot::MemoryDescriptor;
18
17
#[ cfg( feature = "alloc" ) ]
19
18
use {
20
19
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 }
22
21
} ;
23
22
24
23
#[ cfg( all( feature = "unstable" , feature = "alloc" ) ) ]
@@ -269,12 +268,14 @@ pub struct VariableKeys {
269
268
#[ cfg( feature = "alloc" ) ]
270
269
impl VariableKeys {
271
270
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 ] ;
275
277
276
278
Self {
277
- // Give the name buffer a reasonable default capacity.
278
279
name,
279
280
// The initial vendor GUID is arbitrary.
280
281
vendor : VariableVendor ( Guid :: default ( ) ) ,
0 commit comments