summaryrefslogtreecommitdiff
path: root/MokManager.c
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2012-12-03 15:52:48 -0800
committerPeter Jones <pjones@redhat.com>2013-10-22 11:23:51 -0400
commit21e40f0174814b3d91836e38c7cf95c8f2f1f3a4 (patch)
tree97744865a450c24431d7594eeb0e5c6a98d7f419 /MokManager.c
parentbaebb090ea1f65c205ac1fe2b83b42bb979a4907 (diff)
downloadefi-boot-shim-21e40f0174814b3d91836e38c7cf95c8f2f1f3a4.tar.gz
efi-boot-shim-21e40f0174814b3d91836e38c7cf95c8f2f1f3a4.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 'MokManager.c')
-rw-r--r--MokManager.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/MokManager.c b/MokManager.c
index f5ed379c..3da61f43 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -440,7 +440,7 @@ static EFI_STATUS list_keys (void *KeyList, UINTN KeyListSize, CHAR16 *title)
MokListNode *keys = NULL;
INTN key_num = 0;
CHAR16 **menu_strings;
- int i;
+ unsigned int i;
if (KeyListSize < (sizeof(EFI_SIGNATURE_LIST) +
sizeof(EFI_SIGNATURE_DATA))) {
@@ -491,7 +491,7 @@ static EFI_STATUS list_keys (void *KeyList, UINTN KeyListSize, CHAR16 *title)
static UINT8 get_line (UINT32 *length, CHAR16 *line, UINT32 line_max, UINT8 show)
{
EFI_INPUT_KEY key;
- int count = 0;
+ unsigned int count = 0;
do {
key = console_get_keystroke();
@@ -640,7 +640,7 @@ static EFI_STATUS match_password (PASSWORD_CRYPT *pw_crypt,
CHAR16 password[PASSWORD_MAX];
UINT32 pw_length;
UINT8 fail_count = 0;
- int i;
+ unsigned int i;
if (pw_crypt) {
auth_hash = pw_crypt->hash;