Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178121196
D34698.1796032183.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
924 B
Referenced Files
None
Subscribers
None
D34698.1796032183.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
Mon, Nov 30, 9:49 AM (15 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42103844
Default Alt Text
D34698.1796032183.diff (924 B)
Attached To
Mode
D34698: efibootmgr: exit loop if device path size is zero
Attached
Detach File
Event Timeline