Task #734 - libarchive-3.7.4-2.fc41/scan-results.err
back to task #734download
Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/cat/cmdline.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/cpio/cmdline.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/cpio/cpio.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): libarchive-3.7.4-build/libarchive-3.7.4/cpio/cpio.c: scope_hint: In function ‘mode_pass’ libarchive-3.7.4-build/libarchive-3.7.4/cpio/cpio.c:1241:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*cpio.destdir’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 1239| cpio->destdir_len = strlen(destdir); # 1240| cpio->destdir = malloc(cpio->destdir_len + 8); # 1241|-> memcpy(cpio->destdir, destdir, cpio->destdir_len); # 1242| if (cpio->destdir_len == 0 || destdir[cpio->destdir_len - 1] != '/') # 1243| cpio->destdir[cpio->destdir_len++] = '/'; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_acl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_acl.c:1212:8: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 's') # 1210| s = field[0].start; # 1211| len = field[0].end - field[0].start; # 1212|-> if (*s == L'd' && (len == 1 || (len >= 7 # 1213| && wmemcmp((s + 1), L"efault", 6) == 0))) { # 1214| type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_acl.c:1695:8: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 's') # 1693| s = field[0].start; # 1694| len = field[0].end - field[0].start; # 1695|-> if (*s == 'd' && (len == 1 || (len >= 7 # 1696| && memcmp((s + 1), "efault", 6) == 0))) { # 1697| type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_blake2s_ref.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_blake2sp_ref.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_cmdline.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_cryptor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_entry.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_entry_link_resolver.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_entry_sparse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_getdate.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_match.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_match.c:236: error[memleak]: Memory leak: a # 234| match_list_init(&(a->inclusion_gnames)); # 235| time(&a->now); # 236|-> return (&(a->archive)); # 237| } # 238| Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_match.c:607:2: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 605| return (ARCHIVE_FATAL); # 606| } # 607|-> r = archive_read_support_format_raw(ar); # 608| r = archive_read_support_format_empty(ar); # 609| if (r != ARCHIVE_OK) { Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_options.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_ppmd7.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_ppmd8.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_ppmd8.c:692:5: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 690| *ONE_STATE(c1) = upState; # 691| c1->Suffix = REF(c); # 692|-> SetSuccessor(ps[--numPs], REF(c1)); # 693| c = c1; # 694| } Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c: scope_hint: In function '__archive_rb_tree_swap_prune_and_rebalance' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:63:11: warning[-Wanalyzer-null-dereference]: dereference of NULL 'standin' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:374:44: note: in expansion of macro 'RB_POSITION' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:53:35: note: in definition of macro 'RB_SENTINEL_P' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:54:53: note: in expansion of macro 'rb_left' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:58:28: note: in expansion of macro 'RB_LEFT_SENTINEL_P' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:515:13: note: in expansion of macro 'RB_CHILDLESS_P' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:520:14: note: in expansion of macro 'RB_TWOCHILDREN_P' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:538:17: note: in expansion of macro 'RB_POSITION' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:53:35: note: in definition of macro 'RB_SENTINEL_P' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_rb.c:374:44: note: in expansion of macro 'RB_POSITION' # 61| # 62| #define RB_POSITION(rb) \ # 63|-> (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT) # 64| #define RB_RIGHT_P(rb) (RB_POSITION(rb) == RB_DIR_RIGHT) # 65| #define RB_LEFT_P(rb) (RB_POSITION(rb) == RB_DIR_LEFT) Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_add_passphrase.c:83: error[memleak]: Memory leak: p.passphrase # 81| return (NULL); # 82| } # 83|-> return (p); # 84| } # 85| Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_append_filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_data_into_fd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_entry_from_file.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:742:5: warning[deadcode.DeadStores]: Value stored to 'flags' is never read # 740| t->restore_time.noatime = 1; # 741| else if (errno == EPERM) # 742|-> flags &= ~O_NOATIME; # 743| } # 744| #endif Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c: scope_hint: In function 'setup_sparse' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:1207:20: warning[-Wanalyzer-malloc-leak]: leak of '*t.sparse_list' # 1205| t->sparse_list = malloc(sizeof(t->sparse_list[0]) * # 1206| t->sparse_list_size); # 1207|-> if (t->sparse_list == NULL) { # 1208| t->sparse_list_size = 0; # 1209| archive_set_error(&a->archive, ENOMEM, Error: GCC_ANALYZER_WARNING (CWE-775): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c: scope_hint: In function 'tree_reopen' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:2237:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor '*t.initial_dir_fd' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:97: included_from: Included from here. libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:1322:9: note: in expansion of macro 'archive_check_magic' # 2235| * unhelpful and unnecessary errors later. # 2236| */ # 2237|-> if (t->initial_dir_fd < 0) # 2238| t->initial_dir_fd = open(".", o_flag | O_CLOEXEC); # 2239| #endif Error: GCC_ANALYZER_WARNING (CWE-775): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:2238:35: warning[-Wanalyzer-fd-leak]: leak of file descriptor '*t.initial_dir_fd' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:1322:9: note: in expansion of macro 'archive_check_magic' # 2236| */ # 2237| if (t->initial_dir_fd < 0) # 2238|-> t->initial_dir_fd = open(".", o_flag | O_CLOEXEC); # 2239| #endif # 2240| __archive_ensure_cloexec_flag(t->initial_dir_fd); Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_disk_posix.c:2373:13: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'te') # 2371| t->current = t->current->parent; # 2372| te = t->stack; # 2373|-> t->stack = te->next; # 2374| t->dirname_length = te->dirname_length; # 2375| t->basename = t->path.s + t->dirname_length; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_extract2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_open_fd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_open_filename.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_set_options.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_compress.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_gzip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_gzip.c: scope_hint: In function 'peek_at_header' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_gzip.c:194:37: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(p + (sizetype)len)' # 192| /* Reset the name in case of repeat header reads. */ # 193| free(state->name); # 194|-> state->name = strdup((const char *)&p[file_start]); # 195| } # 196| #endif Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_lz4.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_lz4.c: scope_hint: In function 'lz4_allocate_out_block' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_lz4.c:260:12: warning[-Wanalyzer-malloc-leak]: leak of 'out_block' # 258| state->out_block = out_block; # 259| } # 260|-> if (!state->flags.block_independence) # 261| memset(state->out_block, 0, 64 * 1024); # 262| return (ARCHIVE_OK); Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_lz4.c:261:17: warning[-Wanalyzer-malloc-leak]: leak of 'out_block' # 259| } # 260| if (!state->flags.block_independence) # 261|-> memset(state->out_block, 0, 64 * 1024); # 262| return (ARCHIVE_OK); # 263| } Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_program.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_program.c: scope_hint: In function 'archive_read_support_filter_program_signature' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_program.c:152:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc(signature_len)' where non-null expected <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 150| state->signature_len = signature_len; # 151| state->signature = malloc(signature_len); # 152|-> memcpy(state->signature, signature, signature_len); # 153| } # 154| Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_uu.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-835): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_uu.c: scope_hint: In function 'get_line' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_uu.c:181:20: warning[-Wanalyzer-infinite-loop]: infinite loop # 179| # 180| len = 0; # 181|-> while (len < avail) { # 182| switch (ascii[*b]) { # 183| case 0: /* Non-ascii character or control character. */ Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_uu.c: scope_hint: In function 'ensure_in_buff_size' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_uu.c:436:40: warning[-Wanalyzer-malloc-leak]: leak of 'ptr' # 434| free(uudecode->in_buff); # 435| uudecode->in_buff = ptr; # 436|-> uudecode->in_allocated = newsize; # 437| } # 438| return (ARCHIVE_OK); Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_uu.c:494:3: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 492| avail_in + uudecode->in_cnt) != ARCHIVE_OK) # 493| return (ARCHIVE_FATAL); # 494|-> memcpy(uudecode->in_buff + uudecode->in_cnt, # 495| d, avail_in); # 496| d = uudecode->in_buff; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_filter_xz.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_7zip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_7zip.c:828:4: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 826| } # 827| symname = mem; # 828|-> memcpy(symname+symsize, buff, size); # 829| symsize += size; # 830| } Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_7zip.c:2621:9: warning[deadcode.DeadStores]: Although the value stored to 'p' is used in the enclosing expression, the value is never actually read from 'p' # 2619| # 2620| /* Skip one byte. */ # 2621|-> if ((p = header_bytes(a, 1)) == NULL) # 2622| return (-1); # 2623| ll--; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_ar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_cab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_cpio.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_iso9660.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_iso9660.c:3058:16: warning[core.NullDereference]: Access to field 'key' results in a dereference of an undefined pointer value # 3056| while (hole > 0) { # 3057| parent = (hole - 1)/2; # 3058|-> parent_key = heap->files[parent]->key; # 3059| if (file_key >= parent_key) { # 3060| heap->files[hole] = file; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_lha.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_mtree.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c: scope_hint: In function 'read_header' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c:1683:3: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c:3792:8: note: in expansion of macro 'rar_br_read_ahead' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c:3792:8: note: in expansion of macro 'rar_br_read_ahead' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c: scope_hint: In function 'read_header' <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 1681| rar->filename_save = (char*)realloc(rar->filename_save, # 1682| filename_size + 1); # 1683|-> memcpy(rar->filename_save, rar->filename, filename_size + 1); # 1684| rar->filename_save_size = filename_size; # 1685| Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c:3231:12: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'prog') # 3229| prog = filters->progs; # 3230| for (i = 0; i < num; i++) # 3231|-> prog = prog->next; # 3232| if (prog) # 3233| prog->usagecount++; Error: CPPCHECK_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c:3336: error[memleak]: Memory leak: filter # 3334| filter->globaldata = calloc(1, filter->globaldatalen); # 3335| if (!filter->globaldata) # 3336|-> return NULL; # 3337| if (globaldata) # 3338| memcpy(filter->globaldata, globaldata, globaldatalen); Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar.c:3336:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'filter' # 3334| filter->globaldata = calloc(1, filter->globaldatalen); # 3335| if (!filter->globaldata) # 3336|-> return NULL; # 3337| if (globaldata) # 3338| memcpy(filter->globaldata, globaldata, globaldatalen); Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar5.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar5.c:391:11: warning[unix.MallocSizeof]: Result of 'malloc' is converted to a pointer of type 'size_t', which is incompatible with sizeof operand type 'void *' # 389| # 390| cdeque_clear(d); # 391|-> d->arr = malloc(sizeof(void*) * max_capacity_power_of_2); # 392| # 393| return d->arr ? CDE_OK : CDE_ALLOC; Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_rar5.c:2956:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'filt' # 2954| } # 2955| # 2956|-> return ARCHIVE_OK; # 2957| } # 2958| Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_tar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_warc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_xar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_read_support_format_zip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_string.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-465): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_string.c: scope_hint: In function 'archive_string_append' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_string.c:205:12: warning[-Wanalyzer-deref-before-check]: check of 'as' for NULL after already dereferencing it # 203| archive_string_append(struct archive_string *as, const char *p, size_t s) # 204| { # 205|-> if (archive_string_ensure(as, as->length + s + 1) == NULL) # 206| return (NULL); # 207| if (s) Error: GCC_ANALYZER_WARNING (CWE-415): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_util.c: scope_hint: In function 'archive_utility_string_sort_helper' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_util.c:652:40: warning[-Wanalyzer-double-free]: double-'free' of 'lesser' # 650| { # 651| lesser_count++; # 652|-> tmp = (char **)realloc(lesser, # 653| lesser_count * sizeof(char *)); # 654| if (!tmp) { Error: GCC_ANALYZER_WARNING (CWE-415): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_util.c:655:33: warning[-Wanalyzer-double-free]: double-'free' of 'greater' # 653| lesser_count * sizeof(char *)); # 654| if (!tmp) { # 655|-> free(greater); # 656| free(lesser); # 657| return (ARCHIVE_FATAL); Error: GCC_ANALYZER_WARNING (CWE-415): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_util.c:665:40: warning[-Wanalyzer-double-free]: double-'free' of 'greater' # 663| { # 664| greater_count++; # 665|-> tmp = (char **)realloc(greater, # 666| greater_count * sizeof(char *)); # 667| if (!tmp) { Error: GCC_ANALYZER_WARNING (CWE-415): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_util.c:669:33: warning[-Wanalyzer-double-free]: double-'free' of 'lesser' # 667| if (!tmp) { # 668| free(greater); # 669|-> free(lesser); # 670| return (ARCHIVE_FATAL); # 671| } Error: GCC_ANALYZER_WARNING (CWE-415): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_util.c:681:9: warning[-Wanalyzer-double-free]: double-'free' of 'lesser' # 679| for (i = 0; i < lesser_count; i++) # 680| strings[i] = lesser[i]; # 681|-> free(lesser); # 682| # 683| /* pivot */ Error: GCC_ANALYZER_WARNING (CWE-415): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_util.c:690:9: warning[-Wanalyzer-double-free]: double-'free' of 'greater' # 688| for (i = 0; i < greater_count; i++) # 689| strings[lesser_count + 1 + i] = greater[i]; # 690|-> free(greater); # 691| # 692| return (retval1 < retval2) ? retval1 : retval2; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_version_details.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write.c: scope_hint: In function 'archive_write_new' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write.c:123:17: warning[-Wanalyzer-malloc-leak]: leak of 'a' # 121| } # 122| a->nulls = nulls; # 123|-> return (&a->archive); # 124| } # 125| Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_b64encode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_bzip2.c: scope_hint: In function 'archive_compressor_bzip2_open' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_bzip2.c:182:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)' # 180| data->compressed # 181| = (char *)malloc(data->compressed_buffer_size); # 182|-> if (data->compressed == NULL) { # 183| archive_set_error(f->archive, ENOMEM, # 184| "Can't allocate data for compression buffer"); Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_compress.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_gzip.c: scope_hint: In function 'archive_compressor_gzip_open' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_gzip.c:199:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)' # 197| data->compressed # 198| = (unsigned char *)malloc(data->compressed_buffer_size); # 199|-> if (data->compressed == NULL) { # 200| archive_set_error(f->archive, ENOMEM, # 201| "Can't allocate data for compression buffer"); Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_lrzip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_lz4.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_program.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_uuencode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_xz.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_xz.c: scope_hint: In function 'archive_compressor_xz_open' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_xz.c:324:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)' # 322| data->compressed # 323| = (unsigned char *)malloc(data->compressed_buffer_size); # 324|-> if (data->compressed == NULL) { # 325| archive_set_error(f->archive, ENOMEM, # 326| "Can't allocate data for compression buffer"); Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_zstd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_zstd.c: scope_hint: In function 'archive_compressor_zstd_open' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_add_filter_zstd.c:377:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)' # 375| data->out.dst # 376| = (unsigned char *)malloc(data->out.size); # 377|-> if (data->out.dst == NULL) { # 378| archive_set_error(f->archive, ENOMEM, # 379| "Can't allocate data for compression buffer"); Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_disk_posix.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_disk_set_standard_lookup.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_open_file.c:91:8: warning[unix.Errno]: An undefined value may be read from 'errno' # 89| bytesWritten = fwrite(buff, 1, length, mine->f); # 90| if (bytesWritten <= 0) { # 91|-> if (errno == EINTR) # 92| continue; # 93| archive_set_error(a, errno, "Write error"); Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_open_filename.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_open_filename.c:113: error[memleak]: Memory leak: mine # 111| if (errno == ENOMEM) { # 112| archive_set_error(a, ENOMEM, "No memory"); # 113|-> return (ARCHIVE_FATAL); # 114| } # 115| if (mbs_fn) Error: CPPCHECK_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_open_filename.c:123: error[memleak]: Memory leak: mine # 121| "Can't convert '%S' to MBS", # 122| (const wchar_t *)filename); # 123|-> return (ARCHIVE_FAILED); # 124| } # 125| mine->fd = -1; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_7zip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-835): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_7zip.c: scope_hint: In function 'compress_out' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_7zip.c:592:21: warning[-Wanalyzer-infinite-loop]: infinite loop libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_7zip.c: scope_hint: In function 'compress_out' # 590| for (;;) { # 591| /* Compress file data. */ # 592|-> r = compression_code(&(a->archive), &(zip->stream), run); # 593| if (r != ARCHIVE_OK && r != ARCHIVE_EOF) # 594| return (ARCHIVE_FATAL); Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_ar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_cpio_binary.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_cpio_binary.c: scope_hint: In function 'synthesize_ino_value' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_cpio_binary.c:324:9: warning[-Wanalyzer-malloc-leak]: leak of 'newlist' # 322| cpio->ino_list[cpio->ino_list_next].old = ino; # 323| cpio->ino_list[cpio->ino_list_next].new = ino_new; # 324|-> ++cpio->ino_list_next; # 325| return (ino_new); # 326| } Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_cpio_newc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_cpio_odc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_gnutar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_iso9660.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_iso9660.c: scope_hint: In function 'isoent_rr_move' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_iso9660.c:6791:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_iso9660.c: scope_hint: In function 'isoent_rr_move' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_iso9660.c: scope_hint: In function 'isoent_rr_move' # 6789| * its sub directory entries move to rr_move too. # 6790| */ # 6791|-> np = last->ptnext; # 6792| } # 6793| Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_iso9660.c:6888:17: warning[core.NullDereference]: Dereference of undefined pointer value (loaded from field 'last') # 6886| { # 6887| ent->ptnext = NULL; # 6888|-> *pathtbl->last = ent; # 6889| pathtbl->last = &(ent->ptnext); # 6890| pathtbl->cnt ++; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_mtree.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_mtree.c: scope_hint: In function 'mtree_entry_tree_add' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_mtree.c:2151:27: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dent' # 2149| # 2150| if (!__archive_rb_tree_insert_node( # 2151|-> &(dent->dir_info->rbtree), # 2152| (struct archive_rb_node *)file)) { # 2153| np = (struct mtree_entry *)__archive_rb_tree_find_node( Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_pax.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_shar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_shar.c: scope_hint: In function 'archive_write_shar_header' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_shar.c:212:22: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'p' where non-null expected libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_shar.c:37: included_from: Included from here. /usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be non-null # 210| /* Try to create the dir. */ # 211| p = strdup(name); # 212|-> pp = strrchr(p, '/'); # 213| /* If there is a / character, try to create the dir. */ # 214| if (pp != NULL) { Error: GCC_ANALYZER_WARNING (CWE-688): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_shar.c:295:30: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'strdup(archive_entry_pathname(entry))' where non-null expected /usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be non-null # 293| shar->last_dir = strdup(name); # 294| /* Trim a trailing '/'. */ # 295|-> pp = strrchr(shar->last_dir, '/'); # 296| if (pp != NULL && pp[1] == '\0') # 297| *pp = '\0'; Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_ustar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_v7tar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_xar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_zip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_zip.c: scope_hint: In function 'archive_write_zip_finish_entry' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_format_zip.c:1291:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '&zip64' # 1289| return (ARCHIVE_FATAL); # 1290| } # 1291|-> memcpy(zd, zip64, z - zip64); # 1292| /* Zip64 means version needs to be set to at least 4.5 */ # 1293| if (archive_le16dec(zip->file_header + 6) < 45) Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive/archive_write_set_options.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): libarchive-3.7.4-build/libarchive-3.7.4/libarchive/xxhash.c:350:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'state' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/xxhash.c: scope_hint: In function 'XXH32_init' libarchive-3.7.4-build/libarchive-3.7.4/libarchive/xxhash.c:363:19: note: in expansion of macro 'XXH_malloc' # 348| { # 349| struct XXH_state32_t * state = (struct XXH_state32_t *) state_in; # 350|-> state->seed = seed; # 351| state->v1 = seed + PRIME32_1 + PRIME32_2; # 352| state->v2 = seed + PRIME32_2; Error: CPPCHECK_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive_fe/line_reader.c:77: error[memleak]: Memory leak: lr.f # 75| lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL; # 76| # 77|-> return (lr); # 78| } # 79| Error: CPPCHECK_WARNING (CWE-401): libarchive-3.7.4-build/libarchive-3.7.4/libarchive_fe/line_reader.c:77: error[memleak]: Memory leak: lr.pathname # 75| lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL; # 76| # 77|-> return (lr); # 78| } # 79| Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive_fe/passphrase.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive_fe/passphrase.c:186:2: warning[deadcode.DeadStores]: Value stored to 'nr' is never read # 184| for (i = 0; i <= MAX_SIGNO; i++) # 185| signo[i] = 0; # 186|-> nr = -1; # 187| save_errno = 0; # 188| need_restart = 0; Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/libarchive_fe/passphrase.c:187:2: warning[deadcode.DeadStores]: Value stored to 'save_errno' is never read # 185| signo[i] = 0; # 186| nr = -1; # 187|-> save_errno = 0; # 188| need_restart = 0; # 189| /* Error: GCC_ANALYZER_WARNING (CWE-775): libarchive-3.7.4-build/libarchive-3.7.4/libarchive_fe/passphrase.c: scope_hint: In function 'readpassphrase' libarchive-3.7.4-build/libarchive-3.7.4/libarchive_fe/passphrase.c:208:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/dev/tty", 2)' # 206| * generate SIGTTOU, so do it *before* installing the signal handlers. # 207| */ # 208|-> if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { # 209| memcpy(&term, &oterm, sizeof(term)); # 210| if (!(flags & RPP_ECHO_ON)) Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/tar/bsdtar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/tar/cmdline.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/tar/read.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/tar/subst.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/tar/util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/tar/write.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-562): libarchive-3.7.4-build/libarchive-3.7.4/tar/write.c:358: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 356| struct archive_dir archive_dir; # 357| # 358|-> bsdtar->archive_dir = &archive_dir; # 359| memset(&archive_dir, 0, sizeof(archive_dir)); # 360| Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/bsdunzip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/bsdunzip.c:267:11: warning[core.NullDereference]: Array access (from variable 'str') results in a null pointer dereference # 265| if (L_opt) { # 266| for (i = 0; i < len; ++i) # 267|-> str[i] = tolower((unsigned char)path[i]); # 268| } else { # 269| memcpy(str, path, len); Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/bsdunzip.c:269:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 267| str[i] = tolower((unsigned char)path[i]); # 268| } else { # 269|-> memcpy(str, path, len); # 270| } # 271| str[len] = '\0'; Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/bsdunzip.c:271:11: warning[core.NullDereference]: Array access (from variable 'str') results in a null pointer dereference # 269| memcpy(str, path, len); # 270| } # 271|-> str[len] = '\0'; # 272| # 273| return (str); Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/bsdunzip.c:290:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 288| } # 289| if (prefix) { # 290|-> memcpy(str, prefix, prelen); /* includes zero */ # 291| str[prelen - 1] = '/'; /* splat zero */ # 292| } Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/bsdunzip.c:293:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 291| str[prelen - 1] = '/'; /* splat zero */ # 292| } # 293|-> memcpy(str + prelen, path, len); /* includes zero */ # 294| # 295| return (str); Error: CLANG_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/bsdunzip.c:325:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 323| error("malloc()"); # 324| } # 325|-> memcpy(entry->pattern, pattern, len + 1); # 326| STAILQ_INSERT_TAIL(list, entry, link); # 327| } Error: CPPCHECK_WARNING: libarchive-3.7.4-build/libarchive-3.7.4/unzip/cmdline.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.