summaryrefslogtreecommitdiff
path: root/fallback.c
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2012-12-03 15:52:48 -0800
committerPeter Jones <pjones@redhat.com>2014-04-11 14:41:22 -0400
commit5495694c043de510aaf8ff5dcbe17b6547794083 (patch)
treeb69b9617b5680d8a94d92ff4afbada5710487a3a /fallback.c
parent06495f692fa748a553ffbde8bfae2974d8c791c0 (diff)
downloadefi-boot-shim-5495694c043de510aaf8ff5dcbe17b6547794083.tar.gz
efi-boot-shim-5495694c043de510aaf8ff5dcbe17b6547794083.zip
additional bounds-checking on section sizes
This adds additional bounds-checking on the section sizes. Also adds -Wsign-compare to the Makefile and replaces some signed variables with unsigned counteparts for robustness. Signed-off-by: Kees Cook <kees@ubuntu.com>
Diffstat (limited to 'fallback.c')
-rw-r--r--fallback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fallback.c b/fallback.c
index 44638ec0..bc9a3c9d 100644
--- a/fallback.c
+++ b/fallback.c
@@ -229,7 +229,7 @@ EFI_STATUS
find_boot_option(EFI_DEVICE_PATH *dp, CHAR16 *filename, CHAR16 *label,
CHAR16 *arguments, UINT16 *optnum)
{
- int size = sizeof(UINT32) + sizeof (UINT16) +
+ unsigned int size = sizeof(UINT32) + sizeof (UINT16) +
StrLen(label)*2 + 2 + DevicePathSize(dp) +
StrLen(arguments) * 2 + 2;
@@ -768,7 +768,7 @@ try_start_first_option(EFI_HANDLE parent_image_handle)
if (EFI_ERROR(rc)) {
CHAR16 *dps = DevicePathToStr(first_new_option);
UINTN s = DevicePathSize(first_new_option);
- int i;
+ unsigned int i;
UINT8 *dpv = (void *)first_new_option;
Print(L"LoadImage failed: %d\nDevice path: \"%s\"\n", rc, dps);
for (i = 0; i < s; i++) {