Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
crun-HEAD/libocispec/src/ocispec/basic_test_double_array.c:397: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'
#  395|               for (j = 0; j < ptr->strarrays_item_lens[i]; j++)
#  396|                 {
#  397|->                 free (ptr->strarrays[i][j]);
#  398|                   ptr->strarrays[i][j] = NULL;
#  399|               }

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:4529: error[memleak]: Memory leak: ret
# 4527|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 4528|           if (ret->devices == NULL)
# 4529|->           return NULL;
# 4530|           for (size_t i = 0; i < src->devices_len; i++)
# 4531|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'make_runtime_spec_schema_config_vm_image'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:508: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_config_vm.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.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_config_vm.c:516: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_config_vm.c:528:25: note: in expansion of macro 'YAJL_GET_STRING'
#  506|       if (tree == NULL)
#  507|         return NULL;
#  508|->     ret = calloc (1, sizeof (*ret));
#  509|       if (ret == NULL)
#  510|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:508: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_config_vm.c:516: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_config_vm.c:528:25: note: in expansion of macro 'YAJL_GET_STRING'
#  506|       if (tree == NULL)
#  507|         return NULL;
#  508|->     ret = calloc (1, sizeof (*ret));
#  509|       if (ret == NULL)
#  510|         return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def10]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1298: error[memleak]: Memory leak: ret
# 1296|           ret->endpoint_list = calloc (src->endpoint_list_len + 1, sizeof (*ret->endpoint_list));
# 1297|           if (ret->endpoint_list == NULL)
# 1298|->           return NULL;
# 1299|           for (size_t i = 0; i < src->endpoint_list_len; i++)
# 1300|             {

Error: CPPCHECK_WARNING (CWE-401): [#def11]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1529: error[memleak]: Memory leak: ret
# 1527|           ret->utility_vm_path = strdup (src->utility_vm_path);
# 1528|           if (ret->utility_vm_path == NULL)
# 1529|->           return NULL;
# 1530|         }
# 1531|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def12]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1913: error[memleak]: Memory leak: ret
# 1911|           ret->layer_folders = calloc (src->layer_folders_len + 1, sizeof (*ret->layer_folders));
# 1912|           if (ret->layer_folders == NULL)
# 1913|->           return NULL;
# 1914|           for (size_t i = 0; i < src->layer_folders_len; i++)
# 1915|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
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:242: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:316:25: note: in expansion of macro 'YAJL_GET_STRING'
#  240|       if (tree == NULL)
#  241|         return NULL;
#  242|->     ret = calloc (1, sizeof (*ret));
#  243|       if (ret == NULL)
#  244|         return NULL;

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_network_interface_priority'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2282:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2303:19: note: in expansion of macro 'YAJL_IS_NUMBER'
# 2280|       if (tree == NULL)
# 2281|         return NULL;
# 2282|->     ret = calloc (1, sizeof (*ret));
# 2283|       if (ret == NULL)
# 2284|         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_namespace_reference'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2644: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:2652:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2642|       if (tree == NULL)
# 2643|         return NULL;
# 2644|->     ret = calloc (1, sizeof (*ret));
# 2645|       if (ret == NULL)
# 2646|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2644: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:2652:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2642|       if (tree == NULL)
# 2643|         return NULL;
# 2644|->     ret = calloc (1, sizeof (*ret));
# 2645|       if (ret == NULL)
# 2646|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
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): [#def18]
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): [#def19]
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): [#def20]
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): [#def21]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1448: error[memleak]: Memory leak: ret
# 1446|                 {
# 1447|                   yajl_tree_free (resi);
# 1448|->                 return NULL;
# 1449|                 }
# 1450|             }

Error: CPPCHECK_WARNING (CWE-401): [#def22]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1533: error[memleak]: Memory leak: ret
# 1531|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);
# 1532|           if (ret->idmap == NULL)
# 1533|->           return NULL;
# 1534|         }
# 1535|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def23]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:2045: error[memleak]: Memory leak: ret
# 2043|           ret->namespaces = calloc (src->namespaces_len + 1, sizeof (*ret->namespaces));
# 2044|           if (ret->namespaces == NULL)
# 2045|->           return NULL;
# 2046|           for (size_t i = 0; i < src->namespaces_len; i++)
# 2047|             {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def24]
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.95.0
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.95.0
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-19.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.20260420.180315.gd39a405.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.27.1-1.20260423080253122192.pr2068.4.ga8e6ae54
diffbase-store-results-to/tmp/tmpya3pdln7/crun-1.27.1-1.20260423080253122192.pr2068.4.ga8e6ae54.tar.xz
diffbase-time-created2026-04-23 08:29:08
diffbase-time-finished2026-04-23 08:32:05
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpya3pdln7/crun-1.27.1-1.20260423080253122192.pr2068.4.ga8e6ae54.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpya3pdln7/crun-1.27.1-1.20260423080253122192.pr2068.4.ga8e6ae54.src.rpm'
diffbase-tool-versioncsmock-3.8.5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-19.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260420.180315.gd39a405.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.27.1-1.20260423073215324477.main.3.gf709c893
store-results-to/tmp/tmpvxb5ln1n/crun-1.27.1-1.20260423073215324477.main.3.gf709c893.tar.xz
time-created2026-04-23 08:25:02
time-finished2026-04-23 08:28:41
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpvxb5ln1n/crun-1.27.1-1.20260423073215324477.main.3.gf709c893.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpvxb5ln1n/crun-1.27.1-1.20260423073215324477.main.3.gf709c893.src.rpm'
tool-versioncsmock-3.8.5-1.el9