]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Reintroduce size_t cast to clarify the use of a u32 shift on a u64 arg (#2383)
authorDustin L. Howett <dustin@howett.net>
Tue, 22 Oct 2024 08:52:19 +0000 (03:52 -0500)
committerGitHub <noreply@github.com>
Tue, 22 Oct 2024 08:52:19 +0000 (10:52 +0200)
Regressed in #2285

libarchive/archive_read_support_format_rar.c

index 9cf4d639a79db2802345a1b3c09e3dbf10d73dd4..83e8415cb705913b094d5596e5029e92879beb53 100644 (file)
@@ -2803,7 +2803,7 @@ make_table(struct archive_read *a, struct huffman_code *code)
   else
     code->tablesize = code->maxlength;
 
-  code->table = calloc(1U << code->tablesize, sizeof(*code->table));
+  code->table = calloc(((size_t)1U) << code->tablesize, sizeof(*code->table));
 
   return make_table_recurse(a, code, 0, code->table, 0, code->tablesize);
 }