Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources_cpu'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:212:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_cpu_affinity(get_val(tree, "affinity", 3), ctx,  err)'
#  210|       while (0);
#  211|   
#  212|->     if (tree->type == yajl_t_object)
#  213|         {
#  214|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:414:34: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_cpu(get_val(tree, "cpu", 3), ctx,  err)'
#  412|       while (0);
#  413|       ret->affinity = make_runtime_spec_schema_config_windows_resources_cpu_affinity (get_val (tree, "affinity", yajl_t_object), ctx, err);
#  414|->     if (ret->affinity == NULL && *err != 0)
#  415|         return NULL;
#  416|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:417:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  415|         return NULL;
#  416|   
#  417|->     if (tree->type == yajl_t_object)
#  418|         {
#  419|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'clone_runtime_spec_schema_config_windows_resources'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:561:21: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_windows_resources_cpu(*src.cpu)'
#  559|       if (ret == NULL)
#  560|         return NULL;
#  561|->     ret->count = src->count;
#  562|       ret->count_present = src->count_present;
#  563|       ret->shares = src->shares;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:570:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  568|         {
#  569|           ret->affinity = clone_runtime_spec_schema_config_windows_resources_cpu_affinity (src->affinity);
#  570|->         if (ret->affinity == NULL)
#  571|             return NULL;
#  572|         }

Error: CPPCHECK_WARNING (CWE-401): [#def6]
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: CPPCHECK_WARNING (CWE-401): [#def7]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2808: error[memleak]: Memory leak: ret
# 2806|           ret->path = strdup (src->path);
# 2807|           if (ret->path == NULL)
# 2808|->           return NULL;
# 2809|         }
# 2810|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
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:102:12: 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_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'
#  100|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  101|   
#  102|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  103|             ret->_residual = resi;
#  104|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:455:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:310:28: note: in expansion of macro 'YAJL_IS_TRUE'
#  453|       while (0);
#  454|   
#  455|->     if (tree->type == yajl_t_object)
#  456|         {
#  457|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:455:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_seccomp(get_val(tree, "seccomp", 3), ctx,  err)'
#  453|       while (0);
#  454|   
#  455|->     if (tree->type == yajl_t_object)
#  456|         {
#  457|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:151:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_cpu(get_val(tree, "cpu", 3), ctx,  err)'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:173:19: note: in expansion of macro 'YAJL_IS_NUMBER'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:173:19: note: in expansion of macro 'YAJL_IS_NUMBER'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:173:19: note: in expansion of macro 'YAJL_IS_NUMBER'
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|   #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|-> #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_seccomp(get_val(tree, "seccomp", 3), ctx,  err)'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:310:28: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:310:28: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:310:28: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update'
crun-HEAD/src/libcrun/utils.h:74:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(184)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
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'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Scan Properties

analyzer-version-clippy1.86.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.86.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-220.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.20250509.165649.g41c6174.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.21-1.20250512094810910083.main.93.g819c2a76
diffbase-store-results-to/tmp/tmp4famwkf5/crun-1.21-1.20250512094810910083.main.93.g819c2a76.tar.xz
diffbase-time-created2025-05-13 07:59:02
diffbase-time-finished2025-05-13 08:04:56
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp4famwkf5/crun-1.21-1.20250512094810910083.main.93.g819c2a76.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp4famwkf5/crun-1.21-1.20250512094810910083.main.93.g819c2a76.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-220.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250509.165649.g41c6174.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.21-1.20250513075133225934.pr1748.95.gfe3edf23
store-results-to/tmp/tmp30tslnr5/crun-1.21-1.20250513075133225934.pr1748.95.gfe3edf23.tar.xz
time-created2025-05-13 08:05:15
time-finished2025-05-13 08:10:14
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp30tslnr5/crun-1.21-1.20250513075133225934.pr1748.95.gfe3edf23.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp30tslnr5/crun-1.21-1.20250513075133225934.pr1748.95.gfe3edf23.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9