Page MenuHomeFreeBSD

efibootmgr: fix an incorrect error handling check
ClosedPublic

Authored by mhorne on Nov 30 2020, 7:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 27, 1:47 AM
Unknown Object (File)
Sat, Jun 27, 1:47 AM
Unknown Object (File)
Tue, Jun 23, 7:04 PM
Unknown Object (File)
Sat, Jun 20, 2:29 AM
Unknown Object (File)
May 10 2026, 11:56 PM
Unknown Object (File)
May 10 2026, 5:52 AM
Unknown Object (File)
May 8 2026, 8:13 AM
Unknown Object (File)
May 8 2026, 6:43 AM
Subscribers
None

Details

Summary

efivar_device_path_to_unix_path() returns standard error codes on
failure and zero on success. Checking for a return value less than zero
means that the actual failure cases won't be handled. This could
manifest as a segfault during the subsequent call to printf().

Test Plan

With this patch applied, efibootmgr -E doesn't segfault on my system, and
instead gives:
efibootmgr: Can't convert to unix path

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mhorne created this revision.
mhorne retitled this revision from efibootmgr: fix an error return check to efibootmgr: fix an incorrect error handling check.Nov 30 2020, 7:46 PM
This revision is now accepted and ready to land.Nov 30 2020, 8:41 PM
This revision was automatically updated to reflect the committed changes.