]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Reintroduce size_t cast to clarify the use of a u32 shift on a u64 arg
authorDustin L. Howett <dustin@howett.net>
Tue, 22 Oct 2024 08:52:19 +0000 (03:52 -0500)
committerMartin Matuska <martin@matuska.de>
Tue, 19 Nov 2024 00:13:11 +0000 (01:13 +0100)
Closes #2383
Regressed in #2285

(cherry picked from commit ac43e8e3fea3ed80cb7c35659decf8ca5a315ba9)

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);
 }