Error: COMPILER_WARNING (CWE-704): [#def1] libarchive-3.8.4/libarchive/archive_options.c: scope_hint: In function 'parse_option' libarchive-3.8.4/libarchive/archive_options.c:179:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 179 | p = strchr(opt, ','); # | ^ # 177| val = "1"; # 178| # 179|-> p = strchr(opt, ','); # 180| # 181| if (p != NULL) { Error: COMPILER_WARNING (CWE-704): [#def2] libarchive-3.8.4/libarchive/archive_options.c:179:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 177| val = "1"; # 178| # 179|-> p = strchr(opt, ','); # 180| # 181| if (p != NULL) { Error: COMPILER_WARNING (CWE-704): [#def3] libarchive-3.8.4/libarchive/archive_options.c:194:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 194 | p = strchr(opt, ':'); # | ^ # 192| } # 193| # 194|-> p = strchr(opt, ':'); # 195| if (p != NULL) { # 196| *p = '\0'; Error: COMPILER_WARNING (CWE-704): [#def4] libarchive-3.8.4/libarchive/archive_options.c:194:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 192| } # 193| # 194|-> p = strchr(opt, ':'); # 195| if (p != NULL) { # 196| *p = '\0'; Error: COMPILER_WARNING (CWE-704): [#def5] libarchive-3.8.4/libarchive/archive_options.c:201:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 201 | p = strchr(opt, '='); # | ^ # 199| } # 200| # 201|-> p = strchr(opt, '='); # 202| if (p != NULL) { # 203| *p = '\0'; Error: COMPILER_WARNING (CWE-704): [#def6] libarchive-3.8.4/libarchive/archive_options.c:201:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 199| } # 200| # 201|-> p = strchr(opt, '='); # 202| if (p != NULL) { # 203| *p = '\0'; Error: COMPILER_WARNING (CWE-704): [#def7] libarchive-3.8.4/libarchive/archive_pack_dev.c: scope_hint: In function 'pack_find' libarchive-3.8.4/libarchive/archive_pack_dev.c:324:16: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 324 | format = bsearch(name, formats, # | ^ # 322| struct format *format; # 323| # 324|-> format = bsearch(name, formats, # 325| sizeof(formats)/sizeof(formats[0]), # 326| sizeof(formats[0]), compare_format); Error: COMPILER_WARNING (CWE-704): [#def8] libarchive-3.8.4/libarchive/archive_pack_dev.c:324:16: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 322| struct format *format; # 323| # 324|-> format = bsearch(name, formats, # 325| sizeof(formats)/sizeof(formats[0]), # 326| sizeof(formats[0]), compare_format); Error: GCC_ANALYZER_WARNING (CWE-688): [#def9] libarchive-3.8.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 libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:143:12: branch_false: following 'false' branch (when 'state' is non-NULL)... libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:145:22: branch_false: ...to here libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:146:12: branch_false: following 'false' branch... libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:13: branch_false: ...to here libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:12: branch_true: following 'true' branch... libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:150:17: branch_true: ...to here libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:151:36: acquire_memory: this call could return NULL libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:152:17: danger: argument 1 ('malloc(signature_len)') from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected # 150| state->signature_len = signature_len; # 151| state->signature = malloc(signature_len); # 152|-> memcpy(state->signature, signature, signature_len); # 153| } # 154| Error: COMPILER_WARNING (CWE-704): [#def10] libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c: scope_hint: In function 'readline' libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c:2110:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 2110 | nl = memchr(t, '\n', bytes_read); # | ^ # 2108| if (bytes_read < 0) # 2109| return (ARCHIVE_FATAL); # 2110|-> nl = memchr(t, '\n', bytes_read); # 2111| /* If we found '\n', trim the read to end exactly there. */ # 2112| if (nl != NULL) { Error: COMPILER_WARNING (CWE-704): [#def11] libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c:2110:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 2108| if (bytes_read < 0) # 2109| return (ARCHIVE_FATAL); # 2110|-> nl = memchr(t, '\n', bytes_read); # 2111| /* If we found '\n', trim the read to end exactly there. */ # 2112| if (nl != NULL) { Error: COMPILER_WARNING (CWE-704): [#def12] libarchive-3.8.4/libarchive/archive_read_support_format_tar.c: scope_hint: In function 'readline' libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3549:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 3549 | p = memchr(t, '\n', bytes_read); # | ^ # 3547| return (ARCHIVE_FATAL); # 3548| s = t; /* Start of line? */ # 3549|-> p = memchr(t, '\n', bytes_read); # 3550| /* If we found '\n' in the read buffer, return pointer to that. */ # 3551| if (p != NULL) { Error: COMPILER_WARNING (CWE-704): [#def13] libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3549:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 3547| return (ARCHIVE_FATAL); # 3548| s = t; /* Start of line? */ # 3549|-> p = memchr(t, '\n', bytes_read); # 3550| /* If we found '\n' in the read buffer, return pointer to that. */ # 3551| if (p != NULL) { Error: COMPILER_WARNING (CWE-704): [#def14] libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3590:19: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 3590 | p = memchr(t, '\n', bytes_read); # | ^ # 3588| return (ARCHIVE_FATAL); # 3589| s = t; /* Start of line? */ # 3590|-> p = memchr(t, '\n', bytes_read); # 3591| /* If we found '\n', trim the read. */ # 3592| if (p != NULL) { Error: COMPILER_WARNING (CWE-704): [#def15] libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3590:19: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 3588| return (ARCHIVE_FATAL); # 3589| s = t; /* Start of line? */ # 3590|-> p = memchr(t, '\n', bytes_read); # 3591| /* If we found '\n', trim the read. */ # 3592| if (p != NULL) { Error: CPPCHECK_WARNING (CWE-457): [#def16] libarchive-3.8.4/libarchive/archive_util.c:461: error[uninitvar]: Uninitialized variable: rgid # 459| if (getresgid(&ruid, &egid, &sgid) != 0) # 460| return (-1); # 461|-> if (rgid != egid || rgid != sgid) # 462| return (1); # 463| #elif HAVE_GETEUID Error: GCC_ANALYZER_WARNING (CWE-457): [#def17] libarchive-3.8.4/libarchive/archive_util.c:461:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'rgid' libarchive-3.8.4/libarchive/archive_util.c:455:12: branch_false: following 'false' branch... libarchive-3.8.4/libarchive/archive_util.c:457:13: branch_false: ...to here libarchive-3.8.4/libarchive/archive_util.c:457:12: branch_false: following 'false' branch... libarchive-3.8.4/libarchive/archive_util.c:459:12: branch_false: following 'false' branch... libarchive-3.8.4/libarchive/archive_util.c:461:13: branch_false: ...to here libarchive-3.8.4/libarchive/archive_util.c:461:12: danger: use of uninitialized value 'rgid' here # 459| if (getresgid(&ruid, &egid, &sgid) != 0) # 460| return (-1); # 461|-> if (rgid != egid || rgid != sgid) # 462| return (1); # 463| #elif HAVE_GETEUID Error: COMPILER_WARNING (CWE-457): [#def18] libarchive-3.8.4/libarchive/archive_util.c:461:12: warning[-Wmaybe-uninitialized]: 'rgid' may be used uninitialized # 461 | if (rgid != egid || rgid != sgid) # | ^ libarchive-3.8.4/libarchive/archive_util.c: scope_hint: In function '__archive_get_tempdir' libarchive-3.8.4/libarchive/archive_util.c:454:15: note: 'rgid' was declared here # 454 | gid_t rgid, egid, sgid; # | ^~~~ # 459| if (getresgid(&ruid, &egid, &sgid) != 0) # 460| return (-1); # 461|-> if (rgid != egid || rgid != sgid) # 462| return (1); # 463| #elif HAVE_GETEUID Error: COMPILER_WARNING (CWE-704): [#def19] libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c: scope_hint: In function 'get_path_component' libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5532:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 5532 | p = strchr(fn, '/'); # | ^ # 5530| size_t l; # 5531| # 5532|-> p = strchr(fn, '/'); # 5533| if (p == NULL) { # 5534| if ((l = strlen(fn)) == 0) Error: COMPILER_WARNING (CWE-704): [#def20] libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5532:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 5530| size_t l; # 5531| # 5532|-> p = strchr(fn, '/'); # 5533| if (p == NULL) { # 5534| if ((l = strlen(fn)) == 0) Error: COMPILER_WARNING (CWE-704): [#def21] libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c: scope_hint: In function 'get_path_component' libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2047:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 2047 | p = strchr(fn, '/'); # | ^ # 2045| size_t l; # 2046| # 2047|-> p = strchr(fn, '/'); # 2048| if (p == NULL) { # 2049| if ((l = strlen(fn)) == 0) Error: COMPILER_WARNING (CWE-704): [#def22] libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2047:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 2045| size_t l; # 2046| # 2047|-> p = strchr(fn, '/'); # 2048| if (p == NULL) { # 2049| if ((l = strlen(fn)) == 0) Error: COMPILER_WARNING (CWE-704): [#def23] libarchive-3.8.4/libarchive/archive_write_set_format_warc.c: scope_hint: In function '_popul_ehdr' libarchive-3.8.4/libarchive/archive_write_set_format_warc.c:374:29: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type # 374 | char *chk = strchr(hdr.tgturi, ':'); # | ^~~~~~ # 372| static const char _fil[] = "file://"; # 373| const char *u; # 374|-> char *chk = strchr(hdr.tgturi, ':'); # 375| # 376| if (chk != NULL && chk[1U] == '/' && chk[2U] == '/') { Error: COMPILER_WARNING (CWE-704): [#def24] libarchive-3.8.4/libarchive/archive_write_set_format_warc.c:374:29: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type # 372| static const char _fil[] = "file://"; # 373| const char *u; # 374|-> char *chk = strchr(hdr.tgturi, ':'); # 375| # 376| if (chk != NULL && chk[1U] == '/' && chk[2U] == '/') { Error: COMPILER_WARNING (CWE-704): [#def25] libarchive-3.8.4/libarchive/archive_write_set_format_xar.c: scope_hint: In function 'get_path_component' libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2276:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 2276 | p = strchr(fn, '/'); # | ^ # 2274| int l; # 2275| # 2276|-> p = strchr(fn, '/'); # 2277| if (p == NULL) { # 2278| if ((l = (int)strlen(fn)) == 0) Error: COMPILER_WARNING (CWE-704): [#def26] libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2276:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 2274| int l; # 2275| # 2276|-> p = strchr(fn, '/'); # 2277| if (p == NULL) { # 2278| if ((l = (int)strlen(fn)) == 0) Error: CPPCHECK_WARNING (CWE-476): [#def27] libarchive-3.8.4/libarchive/xxhash.c:350: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state # 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: GCC_ANALYZER_WARNING (CWE-476): [#def28] libarchive-3.8.4/libarchive/xxhash.c:350:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'state' libarchive-3.8.4/libarchive/xxhash.c:363:19: acquire_memory: this call could return NULL libarchive-3.8.4/libarchive/xxhash.c:364:5: call_function: inlined call to 'XXH32_resetState' from 'XXH32_init' # 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-476): [#def29] libarchive-3.8.4/libarchive/xxhash.c:351: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state # 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; # 353| state->v3 = seed + 0; Error: CPPCHECK_WARNING (CWE-476): [#def30] libarchive-3.8.4/libarchive/xxhash.c:352: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state # 350| state->seed = seed; # 351| state->v1 = seed + PRIME32_1 + PRIME32_2; # 352|-> state->v2 = seed + PRIME32_2; # 353| state->v3 = seed + 0; # 354| state->v4 = seed - PRIME32_1; Error: CPPCHECK_WARNING (CWE-476): [#def31] libarchive-3.8.4/libarchive/xxhash.c:353: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state # 351| state->v1 = seed + PRIME32_1 + PRIME32_2; # 352| state->v2 = seed + PRIME32_2; # 353|-> state->v3 = seed + 0; # 354| state->v4 = seed - PRIME32_1; # 355| state->total_len = 0; Error: CPPCHECK_WARNING (CWE-476): [#def32] libarchive-3.8.4/libarchive/xxhash.c:354: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state # 352| state->v2 = seed + PRIME32_2; # 353| state->v3 = seed + 0; # 354|-> state->v4 = seed - PRIME32_1; # 355| state->total_len = 0; # 356| state->memsize = 0; Error: CPPCHECK_WARNING (CWE-476): [#def33] libarchive-3.8.4/libarchive/xxhash.c:355: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state # 353| state->v3 = seed + 0; # 354| state->v4 = seed - PRIME32_1; # 355|-> state->total_len = 0; # 356| state->memsize = 0; # 357| return XXH_OK; Error: CPPCHECK_WARNING (CWE-476): [#def34] libarchive-3.8.4/libarchive/xxhash.c:356: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state # 354| state->v4 = seed - PRIME32_1; # 355| state->total_len = 0; # 356|-> state->memsize = 0; # 357| return XXH_OK; # 358| } Error: COMPILER_WARNING (CWE-704): [#def35] libarchive-3.8.4/tar/bsdtar.c: scope_hint: In function ‘main’ libarchive-3.8.4/tar/bsdtar.c:381:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 381 | uptr = strchr(bsdtar->argument, ':'); # | ^ # 379| tptr = NULL; # 380| # 381|-> uptr = strchr(bsdtar->argument, ':'); # 382| if (uptr != NULL) { # 383| if (uptr[1] == '\0') { Error: COMPILER_WARNING (CWE-704): [#def36] libarchive-3.8.4/tar/bsdtar.c:381:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 379| tptr = NULL; # 380| # 381|-> uptr = strchr(bsdtar->argument, ':'); # 382| if (uptr != NULL) { # 383| if (uptr[1] == '\0') { Error: COMPILER_WARNING (CWE-704): [#def37] libarchive-3.8.4/tar/bsdtar.c:660:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 660 | uptr = strchr(bsdtar->argument, ':'); # | ^ # 658| tptr = NULL; # 659| # 660|-> uptr = strchr(bsdtar->argument, ':'); # 661| if (uptr != NULL) { # 662| if (uptr[1] == 0) { Error: COMPILER_WARNING (CWE-704): [#def38] libarchive-3.8.4/tar/bsdtar.c:660:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 658| tptr = NULL; # 659| # 660|-> uptr = strchr(bsdtar->argument, ':'); # 661| if (uptr != NULL) { # 662| if (uptr[1] == 0) {
| analyzer-version-clippy | 1.97.1 |
| analyzer-version-cppcheck | 2.21.1 |
| analyzer-version-gcc | 16.1.1 |
| analyzer-version-gcc-analyzer | 16.1.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.97.1 |
| diffbase-analyzer-version-cppcheck | 2.21.1 |
| diffbase-analyzer-version-gcc | 16.1.1 |
| diffbase-analyzer-version-gcc-analyzer | 16.1.1 |
| diffbase-analyzer-version-shellcheck | 0.11.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-89.us-west-2.compute.internal |
| diffbase-known-false-positives | /usr/share/csmock/known-false-positives.js |
| diffbase-known-false-positives-rpm | known-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | libarchive-3.8.8-3.fc45 |
| diffbase-store-results-to | /tmp/tmpe4nps44f/libarchive-3.8.8-3.fc45.tar.xz |
| diffbase-time-created | 2026-08-03 17:09:02 |
| diffbase-time-finished | 2026-08-03 17:11:09 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpe4nps44f/libarchive-3.8.8-3.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpe4nps44f/libarchive-3.8.8-3.fc45.src.rpm' |
| diffbase-tool-version | csmock-3.8.7.20260803.142340.gb75b18e-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-89.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | libarchive-3.8.4-2.fc44 |
| store-results-to | /tmp/tmpcnlmmpov/libarchive-3.8.4-2.fc44.tar.xz |
| time-created | 2026-08-03 17:05:37 |
| time-finished | 2026-08-03 17:08:35 |
| title | Fixed findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpcnlmmpov/libarchive-3.8.4-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpcnlmmpov/libarchive-3.8.4-2.fc44.src.rpm' |
| tool-version | csmock-3.8.7.20260803.142340.gb75b18e-1.el9 |