Skip to contentSkip to conversation

libsepol: Use matching integer types in scope_write()

PATCH In review James Carter 2 participants 3 messages Aug 18 – Aug 19 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsepol: Use matching integer types in scope_write()

Since the variable "items" is used where a size_t is expected, just make it a size_t.

Since the variable "i" is compared to an uint32_t, just make it a uint32_t.

---
 libsepol/src/write.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
libsepol/src/write.c +2 -1
index 4bb39f99..a0c9af85 100644
@@ -1947,7 +1947,8 @@ static int scope_write(hashtab_key_t key, hashtab_datum_t datum, void *ptr)
 	struct policy_file *fp = pd->fp;
 	uint32_t static_buf[32], *dyn_buf = NULL, *buf;
 	size_t key_len = strlen(key);
-	unsigned int items = 2 + scope->decl_ids_len, i;
+	size_t items = 2 + scope->decl_ids_len;
+	uint32_t i;
 	int rc;
 
 	buf = static_buf;
Signature · 1 line
2.55.0