summaryrefslogtreecommitdiff
path: root/MokManager.c
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2013-10-22 11:23:51 -0400
committerPeter Jones <pjones@redhat.com>2013-10-22 11:23:51 -0400
commita0df78b73f922bde50e753d46e9276777bf883ac (patch)
tree97744865a450c24431d7594eeb0e5c6a98d7f419 /MokManager.c
parentee4deae045c984e265a30c42e85a267e14e84680 (diff)
downloadefi-boot-shim-a0df78b73f922bde50e753d46e9276777bf883ac.tar.gz
efi-boot-shim-a0df78b73f922bde50e753d46e9276777bf883ac.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;