diff options
author | Tom Rini <trini@konsulko.com> | 2021-05-25 11:48:55 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-05-25 11:48:55 -0400 |
commit | f25a0c3742cf96714fa34c80370e706d6df9bf66 (patch) | |
tree | ff10cf5994211aceae488e8368e79d60f092334b /lib/efi_loader/efi_device_path.c | |
parent | 4c3e99460c6551ef1a626375dd1dd1f7f7c55af8 (diff) | |
parent | 1f6871df40d6ad94a00a2dcd46f3cc91b232c4d6 (diff) |
Merge tag 'efi-2021-07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2021-07-rc4
Documentation:
* correct mmc man-page
Bug fixes:
* reduce code size of efidebug command
* remove 31 character limit for file paths in efidebug command
* fix build warning in the TCG2 protocol implementation
Diffstat (limited to 'lib/efi_loader/efi_device_path.c')
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 4b20859b25..76c2f82fe6 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -1171,7 +1171,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, struct blk_desc *desc = NULL; struct disk_partition fs_partition; int part = 0; - char filename[32] = { 0 }; /* dp->str is u16[32] long */ + char *filename; char *s; if (path && !file) @@ -1198,12 +1198,17 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, if (!path) return EFI_SUCCESS; - snprintf(filename, sizeof(filename), "%s", path); + filename = calloc(1, strlen(path) + 1); + if (!filename) + return EFI_OUT_OF_RESOURCES; + + sprintf(filename, "%s", path); /* DOS style file path: */ s = filename; while ((s = strchr(s, '/'))) *s++ = '\\'; *file = efi_dp_from_file(desc, part, filename); + free(filename); if (!*file) return EFI_INVALID_PARAMETER; |