In vars_del_variable(), this "if" statement always failed because
read_file() returned the actual file size +1.
if (rc < 0 || (buf_size != sizeof(efi_kernel_variable_64_t) &&
buf_size != sizeof(efi_kernel_variable_32_t)))
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
goto err;
rc = read_file(fd, &buf, &buf_size);
+ buf_size -= 1; /* read_file pads out 1 extra byte to NUL it */
if (rc < 0 || (buf_size != sizeof(efi_kernel_variable_64_t) &&
buf_size != sizeof(efi_kernel_variable_32_t)))
goto err;