grub2/0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch

40 lines
1.3 KiB
Diff

From 28f83642deb777cce122c3629ddbd7b44a7f95b4 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Thu, 23 Feb 2017 22:39:37 +0800
Subject: [PATCH] Revert "efi: properly terminate filepath with NULL in
chainloader"
This reverts commit ce95549cc54b5d6f494608a7c390dba3aab4fba7.
---
grub-core/loader/efi/chainloader.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
index adc8563..522a716 100644
--- a/grub-core/loader/efi/chainloader.c
+++ b/grub-core/loader/efi/chainloader.c
@@ -122,8 +122,6 @@ copy_file_path (grub_efi_file_path_device_path_t *fp,
if (*p == '/')
*p = '\\';
- /* File Path is NULL terminated */
- fp->path_name[size++] = '\0';
fp->header.length = size * sizeof (grub_efi_char16_t) + sizeof (*fp);
}
@@ -158,10 +156,8 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
d = GRUB_EFI_NEXT_DEVICE_PATH (d);
}
- /* File Path is NULL terminated. Allocate space for 2 extra characters */
- /* FIXME why we split path in two components? */
file_path = grub_malloc (size
- + ((grub_strlen (dir_start) + 2)
+ + ((grub_strlen (dir_start) + 1)
* GRUB_MAX_UTF16_PER_UTF8
* sizeof (grub_efi_char16_t))
+ sizeof (grub_efi_file_path_device_path_t) * 2);
--
2.6.6