Newly introduced findings

List of Findings

Error: CPPCHECK_WARNING (CWE-401): [#def1]
crun-HEAD/libocispec/src/ocispec/basic_test_map_string_string_array.c:159: error[memleak]: Memory leak: ret
#  157|         ret->maps = calloc (src->maps_len + 1, sizeof (*ret->maps));
#  158|         if (ret->maps == NULL)
#  159|->         return NULL;
#  160|         for (size_t i = 0; i < src->maps_len; i++)
#  161|           {

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:83:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
#   81|               const char *str = json_object_get_string (val);
#   82|               ret->urls[i] = strdup (str ? str : "");
#   83|->             if (ret->urls[i] == NULL)
#   84|                 return NULL;
#   85|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_index_schema.c: scope_hint: In function 'make_image_spec_schema_image_index_schema_manifests_element'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:395:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
#  393|               const char *str = json_object_get_string (val);
#  394|               ret->urls[i] = strdup (str ? str : "");
#  395|->             if (ret->urls[i] == NULL)
#  396|                 return NULL;
#  397|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
crun-HEAD/libocispec/src/ocispec/json_common.c:1498:7: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
/usr/include/json-c/json.h:27: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.c:6: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
crun-HEAD/libocispec/src/ocispec/json_common.c:1506:1: note: in expansion of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
crun-HEAD/libocispec/src/ocispec/json_common.h:41:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
# 1496|             map->keys[i] = NULL;
# 1497|           }
# 1498|->       free (map->keys);
# 1499|         map->keys = NULL;
# 1500|         free (map->values);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux_seccomp'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2526:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
# 2524|               const char *str = json_object_get_string (val);
# 2525|               ret->flags[i] = strdup (str ? str : "");
# 2526|->             if (ret->flags[i] == NULL)
# 2527|                 return NULL;
# 2528|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2572:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
# 2570|               const char *str = json_object_get_string (val);
# 2571|               ret->architectures[i] = strdup (str ? str : "");
# 2572|->             if (ret->architectures[i] == NULL)
# 2573|                 return NULL;
# 2574|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema_process_scheduler'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1903:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
# 1901|               const char *str = json_object_get_string (val);
# 1902|               ret->flags[i] = strdup (str ? str : "");
# 1903|->             if (ret->flags[i] == NULL)
# 1904|                 return NULL;
# 1905|             }

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_hw_config'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:711:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
#  709|               const char *str = json_object_get_string (val);
#  710|               ret->dtdevs[i] = strdup (str ? str : "");
#  711|->             if (ret->dtdevs[i] == NULL)
#  712|                 return NULL;
#  713|             }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
crun-HEAD/src/libcrun/error.c: scope_hint: In function 'make_json_error'
crun-HEAD/src/libcrun/error.c:413:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'level'
#  411|   
#  412|     json_gen_string (gen, "level", strlen ("level"));
#  413|->   json_gen_string (gen, level, strlen (level));
#  414|   
#  415|     json_gen_string (gen, "time", strlen ("time"));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def10]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'join_namespaces'
crun-HEAD/src/libcrun/linux.c:4130:17: warning[-Wanalyzer-null-argument]: use of NULL 'cwd' where non-null expected
/usr/include/unistd.h:517:12: note: argument 1 of 'chdir' must be non-null
# 4128|         if (value == CLONE_NEWNS)
# 4129|           {
# 4130|->           ret = chdir (cwd);
# 4131|             if (UNLIKELY (ret < 0))
# 4132|               return crun_make_error (err, errno, "chdir `%s`", cwd);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def11]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_join_process'
crun-HEAD/src/libcrun/linux.c:5843:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sync_socket_fd[0]'
# 5841|   exit:
# 5842|     if (sync_socket_fd[0] >= 0)
# 5843|->     TEMP_FAILURE_RETRY (close (sync_socket_fd[0]));
# 5844|     if (sync_socket_fd[1] >= 0)
# 5845|       TEMP_FAILURE_RETRY (close (sync_socket_fd[1]));

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def12]
crun-HEAD/src/libcrun/linux.c:5845:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sync_socket_fd[1]'
# 5843|       TEMP_FAILURE_RETRY (close (sync_socket_fd[0]));
# 5844|     if (sync_socket_fd[1] >= 0)
# 5845|->     TEMP_FAILURE_RETRY (close (sync_socket_fd[1]));
# 5846|     return ret;
# 5847|   }

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def13]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '**cgroup_dirfd.dirfd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def14]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'gid_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c:443:16: note: in expansion of macro 'crun_make_error'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def15]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'targetfd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c:4075:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def16]
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'xstrdup'
crun-HEAD/src/libcrun/utils.h:227:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*str'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'xstrdup'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'xstrdup'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'xstrdup'
crun-HEAD/libocispec/src/ocispec/json_common.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-HEAD/src/libcrun/linux.h:27: included_from: Included from here.
/usr/include/string.h:202:14: note: argument 1 of 'strdup' must be a pointer to a null-terminated string
#  225|       return NULL;
#  226|   
#  227|->   ret = strdup (str);
#  228|     if (ret == NULL)
#  229|       OOM ();

Scan Properties

analyzer-version-clippy1.95.0
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.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.1.1
diffbase-analyzer-version-gcc-analyzer16.1.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-145.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.20260507084651063521.main.20.gf658a6d0
diffbase-store-results-to/tmp/tmpw96n8dkj/crun-1.27.1-1.20260507084651063521.main.20.gf658a6d0.tar.xz
diffbase-time-created2026-05-11 11:04:26
diffbase-time-finished2026-05-11 11:08:21
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,shellcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpw96n8dkj/crun-1.27.1-1.20260507084651063521.main.20.gf658a6d0.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpw96n8dkj/crun-1.27.1-1.20260507084651063521.main.20.gf658a6d0.src.rpm'
diffbase-tool-versioncsmock-3.8.5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-145.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.20260511105544255934.pr2088.23.gaf9770e8
store-results-to/tmp/tmpfkug22dh/crun-1.27.1-1.20260511105544255934.pr2088.23.gaf9770e8.tar.xz
time-created2026-05-11 11:08:33
time-finished2026-05-11 11:11:43
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,shellcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpfkug22dh/crun-1.27.1-1.20260511105544255934.pr2088.23.gaf9770e8.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpfkug22dh/crun-1.27.1-1.20260511105544255934.pr2088.23.gaf9770e8.src.rpm'
tool-versioncsmock-3.8.5-1.el9