[PATCH] libsepol: Use size_t for counting bytes in module.c

James Carter <[email protected]> Fri, 24 Jul 2026 15:28:31 -0400
Newsgroups org.kernel.vger.selinux
Message-ID <[email protected]>
Use size_t for variables used to count bytes in the functions
read_helper() and write_helper().

Signed-off-by: James Carter <[email protected]>
---
 libsepol/src/module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libsepol/src/module.c b/libsepol/src/module.c
index 5fcf5870..fdf05f12 100644
--- a/libsepol/src/module.c
+++ b/libsepol/src/module.c
@@ -345,7 +345,7 @@ int sepol_link_packages(sepol_handle_t *handle, sepol_module_package_t *base,
 #define _read_helper_bufsize BUFSIZ
 static int read_helper(char *buf, struct policy_file *file, uint32_t bytes)
 {
-	uint32_t offset, nel, read_len;
+	size_t offset, nel, read_len;
 	int rc;
 
 	offset = 0;
@@ -842,7 +842,7 @@ cleanup:
 
 static int write_helper(char *data, size_t len, struct policy_file *file)
 {
-	int idx = 0;
+	size_t idx = 0;
 	size_t len2;
 
 	while (len) {
-- 
2.55.0