diff options
author | James Bottomley <JBottomley@Parallels.com> | 2012-12-11 23:40:32 +0000 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-12-11 23:40:32 +0000 |
commit | 88ed9e197bffb3463e5e7e0d12e4c2cb3f0cb4c7 (patch) | |
tree | a7bb4f5d8d5faa880a1a5649804053c5e3175b6f | |
parent | 8bd31f297b8d2697b33c6d2ba6d52dea58fd87d1 (diff) | |
download | efitools-88ed9e197bffb3463e5e7e0d12e4c2cb3f0cb4c7.tar.gz |
simple_file: fix missing files problem
If the filter is NULL, simple file dereferences *NULL. It just so happens on
a lot of systems this is zero and everything works, but on sime it isn't and
thus no files appear. Fix this by explicitly checking for NULL and replacing
it with a pointer to the empty string.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | HashTool.c | 2 | ||||
-rw-r--r-- | KeyTool.c | 2 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | lib/simple_file.c | 2 |
4 files changed, 5 insertions, 3 deletions
@@ -70,7 +70,7 @@ enrol_hash(void) L"This means it will Subsequently Boot with no prompting", L"Remember to make sure it is a genuine binary before Enroling its hash", NULL - }, L"\\", NULL, &file_name); + }, L"\\", L"", &file_name); if (!file_name) /* user pressed ESC */ @@ -78,7 +78,7 @@ select_and_apply(CHAR16 **title, CHAR16 *ext, int key, UINTN options) EFI_HANDLE h = NULL; int use_setsecurevariable = 0; - simple_file_selector(&h, title, NULL, ext, &file_name); + simple_file_selector(&h, title, L"\\", ext, &file_name); if (file_name == NULL) return; @@ -1,5 +1,5 @@ EFIFILES = HelloWorld.efi LockDown.efi Loader.efi ReadVars.efi UpdateVars.efi \ - KeyTool.efi HashTool.efi PreLoader.efi + KeyTool.efi HashTool.efi PreLoader.efi test.efi BINARIES = cert-to-efi-sig-list sig-list-to-certs sign-efi-sig-list \ hash-to-efi-sig-list diff --git a/lib/simple_file.c b/lib/simple_file.c index 53530e6..40ebf27 100644 --- a/lib/simple_file.c +++ b/lib/simple_file.c @@ -405,6 +405,8 @@ simple_file_selector(EFI_HANDLE *im, CHAR16 **title, CHAR16 *name, *result = NULL; if (!name) name = L"\\"; + if (!filter) + filter = L""; if (!*im) { EFI_HANDLE h; CHAR16 *volname; |