Ensure that the device path is sane before trying to decode and print
it. Sponsored by: Netflix, Inc
This commit is contained in:
parent
b7a7fdd7ff
commit
c58442f352
@ -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…
x
Reference in New Issue
Block a user