mokutil/SOURCES/0002-Fix-a-integer-comparis...

31 lines
1004 B
Diff
Raw Normal View History

2022-09-27 15:01:16 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2021-11-04 04:58:35 +00:00
From: Peter Jones <pjones@redhat.com>
Date: Wed, 25 Jul 2018 10:27:34 -0400
Subject: [PATCH] Fix a integer comparison sign issue.
I introduced this, and it's stupid:
mokutil.c: In function 'generate_pw_hash':
mokutil.c:1971:16: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
if (salt_size > settings_len - (next - settings)) {
^
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/mokutil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mokutil.c b/src/mokutil.c
2022-09-27 15:01:16 +00:00
index 8892613..b66c1b8 100644
2021-11-04 04:58:35 +00:00
--- a/src/mokutil.c
+++ b/src/mokutil.c
2022-09-27 15:01:16 +00:00
@@ -2011,7 +2011,7 @@ generate_pw_hash (const char *input_pw)
2021-11-04 04:58:35 +00:00
char *password = NULL;
char *crypt_string;
const char *prefix;
- int settings_len = sizeof (settings) - 2;
+ unsigned int settings_len = sizeof (settings) - 2;
unsigned int pw_len, salt_size;
if (input_pw) {