Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
crun-HEAD/libocispec/src/ocispec/basic_test_double_array.c:395:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-HEAD/libocispec/src/ocispec/basic_test_double_array.c:10:39: note: in definition of macro 'YAJL_GET_ARRAY_NO_CHECK'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'free_basic_test_double_array'
#  393|               for (j = 0; j < ptr->strarrays_item_lens[i]; j++)
#  394|                 {
#  395|->                 free (ptr->strarrays[i][j]);
#  396|                   ptr->strarrays[i][j] = NULL;
#  397|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c: scope_hint: In function 'make_image_spec_schema_content_descriptor'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:63:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:63:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'clone_image_spec_schema_defs_map_string_object'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c:178:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'calloc(*src.len + 1, 8)'
#  176|           for (i = 0; i < src->len; i++)
#  177|             {
#  178|->              ret->values[i] = clone_image_spec_schema_defs_map_string_object_element (src->values[i]);
#  179|                if (ret->values[i] == NULL)
#  180|                  return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c: scope_hint: In function 'make_image_spec_schema_image_layout_schema'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def7]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4527: error[memleak]: Memory leak: ret
# 4525|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 4526|           if (ret->devices == NULL)
# 4527|->           return NULL;
# 4528|           for (size_t i = 0; i < src->devices_len; i++)
# 4529|             {

Error: CPPCHECK_WARNING (CWE-401): [#def8]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1315: error[memleak]: Memory leak: ret
# 1313|           ret->kernel = clone_runtime_spec_schema_config_vm_kernel (src->kernel);
# 1314|           if (ret->kernel == NULL)
# 1315|->           return NULL;
# 1316|         }
# 1317|       if (src->image)

Error: CPPCHECK_WARNING (CWE-401): [#def9]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1321: error[memleak]: Memory leak: ret
# 1319|           ret->image = clone_runtime_spec_schema_config_vm_image (src->image);
# 1320|           if (ret->image == NULL)
# 1321|->           return NULL;
# 1322|         }
# 1323|       if (src->hw_config)

Error: CPPCHECK_WARNING (CWE-401): [#def10]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1327: error[memleak]: Memory leak: ret
# 1325|           ret->hw_config = clone_runtime_spec_schema_config_vm_hw_config (src->hw_config);
# 1326|           if (ret->hw_config == NULL)
# 1327|->           return NULL;
# 1328|         }
# 1329|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def11]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1291: error[memleak]: Memory leak: ret
# 1289|           ret->endpoint_list = calloc (src->endpoint_list_len + 1, sizeof (*ret->endpoint_list));
# 1290|           if (ret->endpoint_list == NULL)
# 1291|->           return NULL;
# 1292|           for (size_t i = 0; i < src->endpoint_list_len; i++)
# 1293|             {

Error: CPPCHECK_WARNING (CWE-401): [#def12]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1521: error[memleak]: Memory leak: ret
# 1519|           ret->utility_vm_path = strdup (src->utility_vm_path);
# 1520|           if (ret->utility_vm_path == NULL)
# 1521|->           return NULL;
# 1522|         }
# 1523|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def13]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1903: error[memleak]: Memory leak: ret
# 1901|           ret->layer_folders = calloc (src->layer_folders_len + 1, sizeof (*ret->layer_folders));
# 1902|           if (ret->layer_folders == NULL)
# 1903|->           return NULL;
# 1904|           for (size_t i = 0; i < src->layer_folders_len; i++)
# 1905|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall_arg'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:241:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:315:25: note: in expansion of macro 'YAJL_GET_STRING'
#  239|       if (tree == NULL)
#  240|         return NULL;
#  241|->     ret = calloc (1, sizeof (*ret));
#  242|       if (ret == NULL)
#  243|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_network_interface_priority'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2273:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2294:19: note: in expansion of macro 'YAJL_IS_NUMBER'
# 2271|       if (tree == NULL)
# 2272|         return NULL;
# 2273|->     ret = calloc (1, sizeof (*ret));
# 2274|       if (ret == NULL)
# 2275|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_namespace_reference'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2633:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2641:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2631|       if (tree == NULL)
# 2632|         return NULL;
# 2633|->     ret = calloc (1, sizeof (*ret));
# 2634|       if (ret == NULL)
# 2635|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2633:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2641:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2631|       if (tree == NULL)
# 2632|         return NULL;
# 2633|->     ret = calloc (1, sizeof (*ret));
# 2634|       if (ret == NULL)
# 2635|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c: scope_hint: In function 'make_runtime_spec_schema_defs_windows_device'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c: scope_hint: In function 'make_runtime_spec_schema_defs_zos_namespace_reference'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def22]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1431: error[memleak]: Memory leak: ret
# 1429|                 {
# 1430|                   yajl_tree_free (resi);
# 1431|->                 return NULL;
# 1432|                 }
# 1433|             }

Error: CPPCHECK_WARNING (CWE-401): [#def23]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1516: error[memleak]: Memory leak: ret
# 1514|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);
# 1515|           if (ret->idmap == NULL)
# 1516|->           return NULL;
# 1517|         }
# 1518|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def24]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:2025: error[memleak]: Memory leak: ret
# 2023|           ret->namespaces = calloc (src->namespaces_len + 1, sizeof (*ret->namespaces));
# 2024|           if (ret->namespaces == NULL)
# 2025|->           return NULL;
# 2026|           for (size_t i = 0; i < src->namespaces_len; i++)
# 2027|             {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def25]
crun-HEAD/src/libcrun/error.c: scope_hint: In function 'make_json_error'
crun-HEAD/src/libcrun/error.c:416:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'level'
#  414|   
#  415|     yajl_gen_string (gen, YAJL_STR ("level"), strlen ("level"));
#  416|->   yajl_gen_string (gen, YAJL_STR (level), strlen (level));
#  417|   
#  418|     yajl_gen_string (gen, YAJL_STR ("time"), strlen ("time"));

Scan Properties

analyzer-version-clippy1.94.1
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.0.1
analyzer-version-gcc-analyzer16.0.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.94.1
diffbase-analyzer-version-cppcheck2.20.0
diffbase-analyzer-version-gcc16.0.1
diffbase-analyzer-version-gcc-analyzer16.0.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-159.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.20260320.200800.gd35503f.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.27-1.20260415154402151992.pr2068.7.gd4d678a6
diffbase-store-results-to/tmp/tmplclzhv4n/crun-1.27-1.20260415154402151992.pr2068.7.gd4d678a6.tar.xz
diffbase-time-created2026-04-15 15:58:40
diffbase-time-finished2026-04-15 16:01:29
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmplclzhv4n/crun-1.27-1.20260415154402151992.pr2068.7.gd4d678a6.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmplclzhv4n/crun-1.27-1.20260415154402151992.pr2068.7.gd4d678a6.src.rpm'
diffbase-tool-versioncsmock-3.8.5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-159.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260320.200800.gd35503f.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.27-1.20260402151752063764.main.6.g0097db1d
store-results-to/tmp/tmptv9nhia6/crun-1.27-1.20260402151752063764.main.6.g0097db1d.tar.xz
time-created2026-04-15 15:54:32
time-finished2026-04-15 15:58:11
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmptv9nhia6/crun-1.27-1.20260402151752063764.main.6.g0097db1d.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmptv9nhia6/crun-1.27-1.20260402151752063764.main.6.g0097db1d.src.rpm'
tool-versioncsmock-3.8.5-1.el9