]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix a bug that Clang Static Analyzer said "Assigned value is garbage or undefined".
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 11 Sep 2012 11:06:25 +0000 (20:06 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 11 Sep 2012 11:06:25 +0000 (20:06 +0900)
libarchive/archive_read_support_format_rar.c

index 3ef7200aa2f62175832a80a5b4bfc5e213d56738..87a729eec5c72225fcda2cc53d033eb3ef689d95 100644 (file)
@@ -2264,7 +2264,7 @@ make_table(struct archive_read *a, struct huffman_code *code)
     code->tablesize = code->maxlength;
 
   code->table =
-    (struct huffman_table_entry *)malloc(sizeof(*code->table)
+    (struct huffman_table_entry *)calloc(1, sizeof(*code->table)
     * (1 << code->tablesize));
 
   return make_table_recurse(a, code, 0, code->table, 0, code->tablesize);