mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
Ensure that the device path is sane before trying to decode and print
it. Sponsored by: Netflix, Inc
This commit is contained in:
parent
46fabdaffc
commit
366a7b3d0c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339799
|
@ -2413,13 +2413,20 @@ UefiDevicePathLibConvertDevicePathToText (
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
efidp_format_device_path(char *buf, size_t len, const_efidp dp, ssize_t max)
|
||||
{
|
||||
char *str;
|
||||
ssize_t retval;
|
||||
|
||||
/*
|
||||
* Basic sanity check on the device path.
|
||||
*/
|
||||
if (!IsDevicePathValid((CONST EFI_DEVICE_PATH_PROTOCOL *) dp, max)) {
|
||||
*buf = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
str = UefiDevicePathLibConvertDevicePathToText (
|
||||
__DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp), FALSE, TRUE);
|
||||
if (str == NULL)
|
||||
|
|
Loading…
Reference in a new issue