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)
Tue, Apr 21, 10:16 PM
Unknown Object (File)
Tue, Apr 21, 12:47 PM
Unknown Object (File)
Fri, Apr 17, 1:48 AM
Unknown Object (File)
Thu, Apr 16, 9:17 PM
Unknown Object (File)
Tue, Apr 14, 6:07 AM
Unknown Object (File)
Sun, Apr 5, 8:52 PM
Unknown Object (File)
Thu, Mar 26, 5:22 PM
Unknown Object (File)
Thu, Mar 26, 12:27 PM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35126
Build 32086: arc lint + arc unit

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.