diff options
author | Mitchell Horne <mhorne@FreeBSD.org> | 2020-11-30 22:16:11 +0000 |
---|---|---|
committer | Mitchell Horne <mhorne@FreeBSD.org> | 2020-11-30 22:16:11 +0000 |
commit | 2e085395e1994a96601abeda4b03ec9455b4d2d4 (patch) | |
tree | 7cac93af9c42977caec2b2bafff9b230a28928b4 /usr.sbin/efibootmgr/efibootmgr.c | |
parent | 8db8bebf1fd70e74dc8125bd2a3db1aa369eddab (diff) | |
download | src-2e085395e1994a96601abeda4b03ec9455b4d2d4.tar.gz src-2e085395e1994a96601abeda4b03ec9455b4d2d4.zip |
efibootmgr: fix an incorrect error handling check
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().
Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D27424
Notes
Notes:
svn path=/head/; revision=368200
Diffstat (limited to 'usr.sbin/efibootmgr/efibootmgr.c')
-rw-r--r-- | usr.sbin/efibootmgr/efibootmgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index e12f869bd4b6..8c7ba82cb5a5 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1034,7 +1034,7 @@ report_esp_device(bool do_dp, bool do_unix) printf("%s\n", buf); exit(0); } - if (efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath) < 0) + if (efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath) != 0) errx(1, "Can't convert to unix path"); if (do_unix) { if (abspath == NULL) |