From: AZero13 Date: Wed, 26 Nov 2025 20:35:54 +0000 (-0500) Subject: Prevent unneeded truncation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=827905c93fc8672eb8ebed48f06fc436ae01e979;p=thirdparty%2Flibarchive.git Prevent unneeded truncation There is no reason we need to cast when every data type involved is size_t --- 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) {