aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <JBottomley@Parallels.com>2012-12-11 23:40:32 +0000
committerJames Bottomley <JBottomley@Parallels.com>2012-12-11 23:40:32 +0000
commit88ed9e197bffb3463e5e7e0d12e4c2cb3f0cb4c7 (patch)
treea7bb4f5d8d5faa880a1a5649804053c5e3175b6f
parent8bd31f297b8d2697b33c6d2ba6d52dea58fd87d1 (diff)
downloadefitools-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.c2
-rw-r--r--KeyTool.c2
-rw-r--r--Makefile2
-rw-r--r--lib/simple_file.c2
4 files changed, 5 insertions, 3 deletions
diff --git a/HashTool.c b/HashTool.c
index ebf028a..adb1749 100644
--- a/HashTool.c
+++ b/HashTool.c
@@ -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 */
diff --git a/KeyTool.c b/KeyTool.c
index 7e21559..6ad1e1e 100644
--- a/KeyTool.c
+++ b/KeyTool.c
@@ -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;
diff --git a/Makefile b/Makefile
index 532465e..401509b 100644
--- a/Makefile
+++ b/Makefile
@@ -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;