Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
diffutils-3.12/lib/exclude.c:604:7: warning[-Wanalyzer-null-dereference]: dereference of NULL 'buf'
diffutils-3.12/lib/exclude.c:657:1: enter_function: entry to 'add_exclude_file'
diffutils-3.12/lib/exclude.c:661:6: branch_false: following 'false' branch (when the strings are non-equal)...
diffutils-3.12/lib/exclude.c:664:14: branch_false: ...to here
diffutils-3.12/lib/exclude.c:665:6: branch_false: following 'false' branch...
diffutils-3.12/lib/exclude.c:667:12: branch_false: ...to here
diffutils-3.12/lib/exclude.c:667:12: call_function: calling 'add_exclude_fp' from 'add_exclude_file'
#  602|         if (buf_count == buf_alloc)
#  603|           buf = xpalloc (buf, &buf_alloc, 1, -1, 1);
#  604|->       buf[buf_count++] = c;
#  605|       }
#  606|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
diffutils-3.12/lib/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(n)'
diffutils-3.12/lib/xmalloc.c:55:1: enter_function: entry to 'xcharalloc'
diffutils-3.12/lib/xmalloc.c:57:10: call_function: calling 'xmalloc' from 'xcharalloc'
#   43|   xmalloc (size_t s)
#   44|   {
#   45|->   return check_nonnull (malloc (s));
#   46|   }
#   47|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
diffutils-3.12/lib/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(s)'
diffutils-3.12/lib/xmalloc.c:312:1: enter_function: entry to 'xmemdup'
diffutils-3.12/lib/xmalloc.c:314:10: call_function: calling 'xmalloc' from 'xmemdup'
#   43|   xmalloc (size_t s)
#   44|   {
#   45|->   return check_nonnull (malloc (s));
#   46|   }
#   47|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
diffutils-3.12/lib/xmalloc.c:298:10: warning[-Wanalyzer-malloc-leak]: leak of 'xcalloc(s, 1)'
diffutils-3.12/lib/xmalloc.c:281:1: enter_function: entry to 'xzalloc'
diffutils-3.12/lib/xmalloc.c:283:10: call_function: calling 'xcalloc' from 'xzalloc'
#  296|   xcalloc (size_t n, size_t s)
#  297|   {
#  298|->   return check_nonnull (calloc (n, s));
#  299|   }
#  300|   

Error: CPPCHECK_WARNING (CWE-457): [#def5]
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): [#def6]
diffutils-3.12/src/diff.c:434:27: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
diffutils-3.12/src/diff.c:326:8: branch_true: following 'true' branch (when 'c >= 0')...
diffutils-3.12/src/diff.c:328:5: branch_true: ...to here
diffutils-3.12/src/diff.c:434:27: branch_true: following 'true' branch (when 'i != 104')...
diffutils-3.12/src/diff.c:436:20: branch_true: ...to here
diffutils-3.12/src/diff.c:434:27: branch_true: following 'true' branch (when 'i != 104')...
diffutils-3.12/src/diff.c:436:20: branch_true: ...to here
diffutils-3.12/src/diff.c:434:27: branch_true: following 'true' branch (when 'i != 104')...
diffutils-3.12/src/diff.c:436:20: branch_true: ...to here
diffutils-3.12/src/diff.c:434:27: branch_false: following 'false' branch (when 'i == 104')...
 branch_false: ...to here
diffutils-3.12/src/diff.c:434:27: danger: '<unknown>' leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  432|   	  int changes = 0;
#  433|   
#  434|-> 	  for (int i = 0; i < sizeof C_ifdef_group_formats; i++)
#  435|   	    {
#  436|   	      char ch = C_ifdef_group_formats[i];

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.86.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.0.1
diffbase-analyzer-version-gcc-analyzer15.0.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-220.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namediffutils-3.10-9.fc42
diffbase-store-results-to/tmp/tmpcxxtlyu4/diffutils-3.10-9.fc42.tar.xz
diffbase-time-created2025-04-25 12:18:37
diffbase-time-finished2025-04-25 12:21:26
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpcxxtlyu4/diffutils-3.10-9.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpcxxtlyu4/diffutils-3.10-9.fc42.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-220.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namediffutils-3.12-1.fc43
store-results-to/tmp/tmpvpoilbq8/diffutils-3.12-1.fc43.tar.xz
time-created2025-04-25 12:21:42
time-finished2025-04-25 12:24:14
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpvpoilbq8/diffutils-3.12-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpvpoilbq8/diffutils-3.12-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9