Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-457): [#def1]
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'format_default_id_mapping'
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.c:1560:12: warning[-Wmaybe-uninitialized]: 'from' may be used uninitialized
# 1560 |       from += used;
#      |            ^~
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.c:1544:12: note: 'from' was declared here
# 1544 |   uint32_t from, available;
#      |            ^~~~
# 1558|         uint32_t used = MIN (container_id, available);
# 1559|         written += sprintf (buffer + written, "%d %d %d\n", 0, from, used);
# 1560|->       from += used;
# 1561|         available -= used;
# 1562|       }

Error: COMPILER_WARNING (CWE-457): [#def2]
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.c:1561:17: warning[-Wmaybe-uninitialized]: 'available' may be used uninitialized
# 1561 |       available -= used;
#      |                 ^~
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.c:1544:18: note: 'available' was declared here
# 1544 |   uint32_t from, available;
#      |                  ^~~~~~~~~
# 1559|         written += sprintf (buffer + written, "%d %d %d\n", 0, from, used);
# 1560|         from += used;
# 1561|->       available -= used;
# 1562|       }
# 1563|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-1.18.2-build/crun-HEAD/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.18.2-build/crun-HEAD/src/libcrun/cgroup.c:24: included_from: Included from here.
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'libcrun_cgroup_enter'
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(24)'
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-HEAD/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#   69|   {
#   70|     void *res = calloc (1, size);
#   71|->   if (UNLIKELY (res == NULL))
#   72|       OOM ();
#   73|     return res;

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer14.2.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer14.2.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-98.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.18.2-1.20241125135143926948.pr1607.16.gfd69065
diffbase-store-results-to/tmp/tmpeghhk0ln/crun-1.18.2-1.20241125135143926948.pr1607.16.gfd69065.tar.xz
diffbase-time-created2024-11-25 14:05:05
diffbase-time-finished2024-11-25 14:10:32
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpeghhk0ln/crun-1.18.2-1.20241125135143926948.pr1607.16.gfd69065.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmpeghhk0ln/crun-1.18.2-1.20241125135143926948.pr1607.16.gfd69065.src.rpm'
diffbase-tool-versioncsmock-3.8.0-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-98.us-west-2.compute.internal
mock-configfedora-rawhide-x86_64
project-namecrun-1.18.2-1.20241119134206105993.main.8.g2b3faef
store-results-to/tmp/tmphvtv65us/crun-1.18.2-1.20241119134206105993.main.8.g2b3faef.tar.xz
time-created2024-11-25 13:58:36
time-finished2024-11-25 14:04:35
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmphvtv65us/crun-1.18.2-1.20241119134206105993.main.8.g2b3faef.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmphvtv65us/crun-1.18.2-1.20241119134206105993.main.8.g2b3faef.src.rpm'
tool-versioncsmock-3.8.0-1.el9