HomeFreeBSD

Minor fixes to edge cases in efi_get_next_variable_name

Description

Minor fixes to edge cases in efi_get_next_variable_name

Fix allocating more memory for the names (unlikely to be needed, but
still best to get right) to ask for the length the kernel told use we
needed, not the old length of the variable. Mind the proper NUL that
we add in the space we allocate. Free the old name string before we
allcoate a new one to limit what we leak to the last one (free passed
in name for the last one in the list), and detect the last one by rv
!= 0 and errno == ENOENT, rather then just the former to avoid false
positives if errno happens to be ENOENT on entry.

Sponsored by: Netflix

Details

Provenance
impAuthored on
Parents
rS323518: Jenkins i386 LINT build uses NOTES to generate its LINT kernel config.
Branches
Unknown
Tags
Unknown