From 827905c93fc8672eb8ebed48f06fc436ae01e979 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Wed, 26 Nov 2025 15:35:54 -0500 Subject: [PATCH] Prevent unneeded truncation There is no reason we need to cast when every data type involved is size_t --- libarchive/archive_cryptor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libarchive/archive_cryptor.c b/libarchive/archive_cryptor.c index 33ee0d2b6..85b20ac9a 100644 --- a/libarchive/archive_cryptor.c +++ b/libarchive/archive_cryptor.c @@ -490,9 +490,9 @@ aes_ctr_update(archive_crypto_ctx *ctx, const uint8_t * const in, size_t in_len, uint8_t * const out, size_t *out_len) { uint8_t *const ebuf = ctx->encr_buf; - unsigned pos = ctx->encr_pos; - unsigned max = (unsigned)((in_len < *out_len)? in_len: *out_len); - unsigned i; + size_t pos = ctx->encr_pos; + size_t max = (in_len < *out_len)? in_len: *out_len; + size_t i; for (i = 0; i < max; ) { if (pos == AES_BLOCK_SIZE) { -- 2.47.3