summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2012-10-12 20:09:33 -0400
committerMatthew Garrett <mjg@redhat.com>2012-10-12 20:09:33 -0400
commite65370d770d9fc6e78516a7054aee1de1a4751d5 (patch)
treed92dd090fd4eb86c8f7d389ab53f3d871293bfb1
parent683959d7ad8c8543d006d5a915603fa30465971b (diff)
downloadefi-boot-shim-e65370d770d9fc6e78516a7054aee1de1a4751d5.tar.gz
efi-boot-shim-e65370d770d9fc6e78516a7054aee1de1a4751d5.zip
Reallocate the DevPath space for the volume label
The size of the DevPath string array was not sufficient to append the volume label. This patch extends the size for the label and re-enables the menu freeing.
-rw-r--r--MokManager.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/MokManager.c b/MokManager.c
index 0d07c33f..1d84a2d9 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -703,14 +703,12 @@ static UINTN draw_menu (struct menu_item *items, UINTN count) {
static void free_menu (struct menu_item *items, UINTN count) {
UINTN i;
-#if 0
for (i=0; i<count; i++) {
if (items[i].text)
FreePool(items[i].text);
}
FreePool(items);
-#endif
}
static void run_menu (struct menu_item *items, UINTN count, UINTN timeout) {
@@ -1127,6 +1125,7 @@ static INTN filesystem_callback (void *data, void *data2, void *data3) {
static INTN find_fs (void *data, void *data2, void *data3) {
EFI_GUID fs_guid = SIMPLE_FILE_SYSTEM_PROTOCOL;
UINTN count, i;
+ UINTN OldSize, NewSize;
EFI_HANDLE **filesystem_handles;
struct menu_item *filesystems;
@@ -1189,8 +1188,13 @@ static INTN find_fs (void *data, void *data2, void *data3) {
filesystems[i].text = DevicePathToStr(path);
else
filesystems[i].text = StrDuplicate(L"Unknown device\n");
- if (VolumeLabel)
+ if (VolumeLabel) {
+ OldSize = (StrLen(filesystems[i].text) + 1) * sizeof(CHAR16);
+ NewSize = OldSize + StrLen(VolumeLabel) * sizeof(CHAR16);
+ filesystems[i].text = ReallocatePool(filesystems[i].text,
+ OldSize, NewSize);
StrCat(filesystems[i].text, VolumeLabel);
+ }
if (buffersize)
FreePool(buffer);