Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
crun-HEAD/src/libcrun/cgroup-resources.c:153:12: warning[-Wanalyzer-null-argument]: use of NULL 'controllers' where non-null expected
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
#  151|         key = xstrdup (name);
#  152|   
#  153|->       it = strchr (key, '.');
#  154|         if (it == NULL)
#  155|           {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'bpfprog_path_from_scope'
crun-HEAD/src/libcrun/cgroup-systemd.c:1389:16: warning[-Wanalyzer-null-argument]: use of NULL 'it' where non-null expected
crun-HEAD/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-HEAD/src/libcrun/cgroup-systemd.c:23: included_from: Included from here.
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
# 1387|     /* Remove dots as EBPF code don't like them.  */
# 1388|     it = flat_scope;
# 1389|->   while ((it = strchr (it, '.')) != NULL)
# 1390|       *it = '_';
# 1391|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def3]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'get_cgroup_scope_path'
crun-HEAD/src/libcrun/cgroup-systemd.c:2028:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
# 2026|     path_to_scope = xstrdup (cgroup_path);
# 2027|   
# 2028|->   cur = strchr (path_to_scope, '/');
# 2029|     while (cur)
# 2030|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'libcrun_destroy_cgroup_systemd'
crun-HEAD/src/libcrun/cgroup-systemd.c:2029:10: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 2027|   
# 2028|     cur = strchr (path_to_scope, '/');
# 2029|->   while (cur)
# 2030|       {
# 2031|         char *next = strchr (cur + 1, '/');

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
crun-HEAD/src/libcrun/cgroup-systemd.c:2031:32: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 2029|     while (cur)
# 2030|       {
# 2031|->       char *next = strchr (cur + 1, '/');
# 2032|         if (next == NULL)
# 2033|           break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_update'
crun-HEAD/src/libcrun/container.c:4019:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'container'
crun-HEAD/src/libcrun/container.c:582:7: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/container.c:1626:12: note: in expansion of macro 'crun_make_error'
# 4017|      * This allows to skip applying same device rules during update.
# 4018|      */
# 4019|->   ret = dedup_devices (container->container_def->linux->resources, resources, state_root, id, err);
# 4020|     if (UNLIKELY (ret < 0))
# 4021|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def7]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '<unknown>'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Scan Properties

analyzer-version-clippy1.88.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.1.1
analyzer-version-gcc-analyzer15.1.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.88.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.1.1
diffbase-analyzer-version-gcc-analyzer15.1.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-121.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.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.22-1.20250708092116567834.main.29.ge8b39523
diffbase-store-results-to/tmp/tmpd7i2n863/crun-1.22-1.20250708092116567834.main.29.ge8b39523.tar.xz
diffbase-time-created2025-07-09 01:16:46
diffbase-time-finished2025-07-09 01:34:20
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,gcc,clippy,cppcheck' '-o' '/tmp/tmpd7i2n863/crun-1.22-1.20250708092116567834.main.29.ge8b39523.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpd7i2n863/crun-1.22-1.20250708092116567834.main.29.ge8b39523.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250626.171830.gc374be3-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-121.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.22-1.20250709010610042161.pr1795.34.gaf2b3a81
store-results-to/tmp/tmpcm4a9q3y/crun-1.22-1.20250709010610042161.pr1795.34.gaf2b3a81.tar.xz
time-created2025-07-09 01:36:12
time-finished2025-07-09 01:54:51
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,gcc,clippy,cppcheck' '-o' '/tmp/tmpcm4a9q3y/crun-1.22-1.20250709010610042161.pr1795.34.gaf2b3a81.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpcm4a9q3y/crun-1.22-1.20250709010610042161.pr1795.34.gaf2b3a81.src.rpm'
tool-versioncsmock-3.8.1.20250626.171830.gc374be3-1.el9