rhboot / efivar

Tools and libraries to work with EFI variables
GNU Lesser General Public License v2.1
238 stars 104 forks source link

empty value of printing variable from --import #254

Closed sherlock-zhouyh closed 7 months ago

sherlock-zhouyh commented 10 months ago

Steps of reproducing the problem(var1 is name of any one uefi variable): 1、efivar --export=test --name=var1 2、efivar --import=test --print 3、efivar --print --name=var1 In step 2, the value part of the var1 would be empty ,which is different from step3. The problem seems to be the if condition in efi_variable_get_data from export.c: if (var->data || !var->data_size) Step2 will work fine when fix like this: if (!var->data || !var->data_size)