Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] diffutils-3.12/lib/exclude.c:579:11: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(pattern)' # 577| # 578| char *str = xstrdup (pattern); # 579|-> if ((options & (EXCLUDE_WILDCARDS | FNM_NOESCAPE)) == EXCLUDE_WILDCARDS) # 580| unescape_pattern (str); # 581| if (hash_insert (ex->head->v.table, str) != str) Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] diffutils-3.12/lib/time_rz.c:88:22: warning[-Wanalyzer-malloc-leak]: leak of 'tzalloc(getenv("TZ"))' diffutils-3.12/lib/time.h:1116:1: enter_function: entry to 'mktime_z' diffutils-3.12/lib/time_rz.c:282:6: branch_false: following 'false' branch (when 'tz' is non-NULL)... diffutils-3.12/lib/time_rz.c:286:27: branch_false: ...to here diffutils-3.12/lib/time_rz.c:286:27: call_function: calling 'set_tz' from 'mktime_z' # 86| { # 87| size_t name_size = name ? strlen (name) + 1 : 0; # 88|-> size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1; # 89| timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size)); # 90| if (tz) Error: GCC_ANALYZER_WARNING (CWE-401): [#def3] diffutils-3.12/lib/time_rz.c:206:10: warning[-Wanalyzer-malloc-leak]: leak of 'set_tz(tz)' diffutils-3.12/lib/time.h:1116:1: enter_function: entry to 'mktime_z' diffutils-3.12/lib/time_rz.c:282:6: branch_false: following 'false' branch (when 'tz' is non-NULL)... diffutils-3.12/lib/time_rz.c:286:27: branch_false: ...to here diffutils-3.12/lib/time_rz.c:286:27: call_function: calling 'set_tz' from 'mktime_z' diffutils-3.12/lib/time_rz.c:286:27: return_function: returning to 'mktime_z' from 'set_tz' diffutils-3.12/lib/time_rz.c:287:10: branch_true: following 'true' branch... diffutils-3.12/lib/time_rz.c:290:25: branch_true: ...to here diffutils-3.12/lib/time_rz.c:206:10: danger: 'set_tz(tz)' leaks here; was allocated at [(10)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/9) # 204| if (env_tz # 205| ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0 # 206|-> : !tz->tz_is_set) # 207| return local_tz; # 208| else Error: CPPCHECK_WARNING (CWE-457): [#def4] diffutils-3.12/src/cmp.c:338: error[uninitvar]: Uninitialized variable: &nullstat # 336| && S_ISCHR (outstat.st_mode) # 337| && stat (NULL_DEVICE, &nullstat) == 0 # 338|-> && same_file (&outstat, &nullstat)) # 339| comparison_type = type_no_stdout; # 340| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def5] diffutils-3.12/src/diff.c:934:7: warning[-Wanalyzer-malloc-leak]: leak of '**reglist.buf.fastmap' diffutils-3.12/src/diff.c:931:6: branch_true: following 'true' branch... diffutils-3.12/src/diff.c:934:7: branch_true: ...to here diffutils-3.12/src/diff.c:934:7: danger: '**reglist.buf.fastmap' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 932| { # 933| /* At least one regexp was specified. Allocate a fastmap for it. */ # 934|-> reglist->buf->fastmap = xmalloc (1 << CHAR_BIT); # 935| if (reglist->multiple_regexps) # 936| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] diffutils-3.12/src/diff3.c:1051:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(72)' diffutils-3.12/src/diff3.c:908:1: enter_function: entry to 'process_diff' diffutils-3.12/src/diff3.c:914:22: call_function: calling 'read_diff' from 'process_diff' diffutils-3.12/src/diff3.c:914:22: return_function: returning to 'process_diff' from 'read_diff' diffutils-3.12/src/diff3.c:916:10: branch_true: following 'true' branch... diffutils-3.12/src/diff3.c:918:33: branch_true: ...to here diffutils-3.12/src/diff3.c:922:27: call_function: calling 'process_diff_control' from 'process_diff' diffutils-3.12/src/diff3.c:922:27: return_function: returning to 'process_diff' from 'process_diff_control' diffutils-3.12/src/diff3.c:1051:7: danger: 'xmalloc(72)' leaks here; was allocated at [(24)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/23) # 1049| # 1050| /* Read first set of digits */ # 1051|-> s = readnum (skipwhite (s), &db->ranges[0][RANGE_START]); # 1052| if (! s) # 1053| return DIFF_ERROR; Error: GCC_ANALYZER_WARNING (CWE-401): [#def7] diffutils-3.12/src/io.c:1299:31: warning[-Wanalyzer-malloc-leak]: leak of 'xnmalloc((long unsigned int)__real__ <unknown>, 8)' diffutils-3.12/src/io.c:1329:1: enter_function: entry to 'read_files' diffutils-3.12/src/io.c:1334:6: branch_true: following 'true' branch... diffutils-3.12/src/io.c:1335:23: branch_true: ...to here diffutils-3.12/src/io.c:1335:23: call_function: calling 'sip' from 'read_files' diffutils-3.12/src/io.c:1335:23: return_function: returning to 'read_files' from 'sip' diffutils-3.12/src/io.c:1342:6: branch_false: following 'false' branch (when 'appears_binary == 0')... diffutils-3.12/src/io.c:1349:3: branch_false: ...to here diffutils-3.12/src/io.c:1349:3: call_function: calling 'find_identical_ends' from 'read_files' # 1297| /* Record the line buffer, adjusted so that # 1298| linbuf[0] points at the first differing line. */ # 1299|-> filevec[0].linbuf = linbuf0 + buffered_prefix; # 1300| filevec[1].linbuf = linbuf1 + buffered_prefix; # 1301| filevec[0].linbuf_base = filevec[1].linbuf_base = - buffered_prefix; Error: GCC_ANALYZER_WARNING (CWE-401): [#def8] diffutils-3.12/src/io.c:1305:1: warning[-Wanalyzer-malloc-leak]: leak of 'linbuf0' diffutils-3.12/src/io.c:1329:1: enter_function: entry to 'read_files' diffutils-3.12/src/io.c:1334:6: branch_true: following 'true' branch... diffutils-3.12/src/io.c:1335:23: branch_true: ...to here diffutils-3.12/src/io.c:1335:23: call_function: calling 'sip' from 'read_files' diffutils-3.12/src/io.c:1335:23: return_function: returning to 'read_files' from 'sip' diffutils-3.12/src/io.c:1342:6: branch_false: following 'false' branch (when 'appears_binary == 0')... diffutils-3.12/src/io.c:1349:3: branch_false: ...to here diffutils-3.12/src/io.c:1349:3: call_function: calling 'find_identical_ends' from 'read_files' # 1303| filevec[1].alloc_lines = alloc_lines1 - buffered_prefix; # 1304| filevec[0].prefix_lines = filevec[1].prefix_lines = lines; # 1305|-> } # 1306| # 1307| /* If 1 < k, then (2**k - prime_offset[k]) is the largest prime less Error: CPPCHECK_WARNING (CWE-758): [#def9] diffutils-3.12/src/sdiff.c:891: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 889| { # 890| gotcmd = true; # 891|-> cmd |= cmd1 << UCHAR_WIDTH; # 892| } # 893| else Error: CPPCHECK_WARNING (CWE-758): [#def10] diffutils-3.12/src/sdiff.c:959: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 957| perror_fatal (squote (0, tmpname)); # 958| # 959|-> int cmd1 = cmd >> UCHAR_WIDTH; # 960| switch (cmd1) # 961| {
| 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 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-182.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 | diffutils-3.12-5.fc44 |
| store-results-to | /tmp/tmpvfu12hln/diffutils-3.12-5.fc44.tar.xz |
| time-created | 2026-08-03 13:45:45 |
| time-finished | 2026-08-03 13:49:03 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpvfu12hln/diffutils-3.12-5.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpvfu12hln/diffutils-3.12-5.fc44.src.rpm' |
| tool-version | csmock-3.8.7.HEAD-1.el9 |