Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153413436
D34698.id104317.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
924 B
Referenced Files
None
Subscribers
None
D34698.id104317.diff
View Options
Index: usr.sbin/efibootmgr/efibootmgr.c
===================================================================
--- usr.sbin/efibootmgr/efibootmgr.c
+++ usr.sbin/efibootmgr/efibootmgr.c
@@ -737,6 +737,7 @@
return 0;
}
+#define EFIDP_MAX(dp, edp) ((uintptr_t)edp - (uintptr_t)dp)
static void
print_loadopt_str(uint8_t *data, size_t datalen)
@@ -779,11 +780,10 @@
* optlen = ep - walker;
*/
indent = 1;
- while (dp < edp) {
- efidp_format_device_path(buf, sizeof(buf), dp,
- (intptr_t)(void *)edp - (intptr_t)(void *)dp);
+ while (dp < edp && EFIDP_MAX(dp, edp) > sizeof(efidp_header)) {
+ efidp_format_device_path(buf, sizeof(buf), dp, EFIDP_MAX(dp, edp));
printf("%*s%s\n", indent, "", buf);
- indent = 10 + len + 1;
+ indent = 11 + len + 1;
rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath);
if (rv == 0) {
printf("%*s%s:%s %s\n", indent + 4, "", dev, relpath, abspath);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 12:52 AM (21 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31943024
Default Alt Text
D34698.id104317.diff (924 B)
Attached To
Mode
D34698: efibootmgr: exit loop if device path size is zero
Attached
Detach File
Event Timeline
Log In to Comment