svn commit: r339798 - head/usr.sbin/efivar
Warner Losh
imp at FreeBSD.org
Fri Oct 26 22:49:26 UTC 2018
Author: imp
Date: Fri Oct 26 22:49:25 2018
New Revision: 339798
URL: https://svnweb.freebsd.org/changeset/base/339798
Log:
Require that we have at least a device path header before
trying to decode the next device path.
Sponsored by: Netflix, Inc
Modified:
head/usr.sbin/efivar/efiutil.c
Modified: head/usr.sbin/efivar/efiutil.c
==============================================================================
--- head/usr.sbin/efivar/efiutil.c Fri Oct 26 22:13:40 2018 (r339797)
+++ head/usr.sbin/efivar/efiutil.c Fri Oct 26 22:49:25 2018 (r339798)
@@ -159,7 +159,7 @@ efi_print_load_option(uint8_t *data, size_t datalen, i
ucs2_to_utf8(descr, &str);
printf("%s", str);
free(str);
- while (dp < edp) {
+ while (dp < edp && (size_t)(edp - dp) > sizeof(efidp_header)) {
efidp_format_device_path(buf, sizeof(buf), dp,
(intptr_t)(void *)edp - (intptr_t)(void *)dp);
dp = (efidp)((char *)dp + efidp_size(dp));
More information about the svn-src-all
mailing list