]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Prevent unneeded truncation 2799/head
authorAZero13 <gfunni234@gmail.com>
Wed, 26 Nov 2025 20:35:54 +0000 (15:35 -0500)
committerAZero13 <gfunni234@gmail.com>
Wed, 26 Nov 2025 20:35:54 +0000 (15:35 -0500)
There is no reason we need to cast when every data type involved is size_t

libarchive/archive_cryptor.c

index 33ee0d2b65cb26389ffbf2c39bb44d224c02730e..85b20ac9acc19a9f31d6b80517b8f27305bd5123 100644 (file)
@@ -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) {