Task #56174 - added.err
back to task #56174download
Error: GCC_ANALYZER_WARNING (CWE-476):
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)'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'clone_image_spec_schema_defs_map_string_object'
# 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: COMPILER_WARNING (CWE-483):
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:179:14: warning[-Wmisleading-indentation]: this 'if' clause does not guard...
# 179 | if (ret->values[i] == NULL);
# | ^~
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c:180:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
# 180 | return NULL;
# | ^~~~~~
# 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;
# 181| }
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:37:23: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
# 35| if (ret->values == NULL)
# 36| return NULL;
# 37|-> for (i = 0; i < len; i++)
# 38| {
# 39| yajl_val val;
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'free_runtime_spec_schema_config_linux_net_devices'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:73:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
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/runtime_spec_schema_config_linux.c: scope_hint: In function 'free_runtime_spec_schema_config_linux_net_devices'
# 71| ptr->values = NULL;
# 72| }
# 73|-> free (ptr);
# 74| }
# 75|
Error: COMPILER_WARNING (CWE-483):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'clone_runtime_spec_schema_config_linux_net_devices'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:126:14: warning[-Wmisleading-indentation]: this 'if' clause does not guard...
# 126 | if (ret->values[i] == NULL);
# | ^~
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:127:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
# 127 | return NULL;
# | ^~~~~~
# 124| {
# 125| ret->values[i] = clone_runtime_spec_schema_defs_linux_net_device (src->values[i]);
# 126|-> if (ret->values[i] == NULL);
# 127| return NULL;
# 128| }
Error: COMPILER_WARNING (CWE-483):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'clone_runtime_spec_schema_config_linux_resources_rdma'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2144:14: warning[-Wmisleading-indentation]: this 'if' clause does not guard...
# 2144 | if (ret->values[i] == NULL);
# | ^~
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2145:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
# 2145 | return NULL;
# | ^~~~~~
# 2142| {
# 2143| ret->values[i] = clone_runtime_spec_schema_defs_linux_rdma (src->values[i]);
# 2144|-> if (ret->values[i] == NULL);
# 2145| return NULL;
# 2146| }
Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3581: error[memleak]: Memory leak: ret
# 3579| ret->boottime = clone_runtime_spec_schema_defs_linux_time_offsets (src->boottime);
# 3580| if (ret->boottime == NULL)
# 3581|-> return NULL;
# 3582| }
# 3583| if (src->monotonic)
Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3587: error[memleak]: Memory leak: ret
# 3585| ret->monotonic = clone_runtime_spec_schema_defs_linux_time_offsets (src->monotonic);
# 3586| if (ret->monotonic == NULL)
# 3587|-> return NULL;
# 3588| }
# 3589| return move_ptr (ret);
Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4292: error[memleak]: Memory leak: ret
# 4290| ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 4291| if (ret->devices == NULL)
# 4292|-> return NULL;
# 4293| for (size_t i = 0; i < src->devices_len; i++)
# 4294| {
Error: GCC_ANALYZER_WARNING (CWE-401):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:8: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:154:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_net_devices(get_val(tree, "netDevices", 3), ctx, err)'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
# 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))
# 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 ))
Error: GCC_ANALYZER_WARNING (CWE-401):
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: COMPILER_WARNING (CWE-563):
crun-HEAD/src/libcrun/net_device.c:258:21: warning[-Wunused-variable]: unused variable 'ifa'
# 258 | struct ifaddrmsg *ifa;
# | ^~~
# 256| configure_ips (int sock, int ifindex, char *buffer, size_t buffer_size, const char *ips, libcrun_error_t *err)
# 257| {
# 258|-> struct ifaddrmsg *ifa;
# 259| struct sockaddr_nl addr = { .nl_family = AF_NETLINK };
# 260| struct ip_addr *ip;
Error: COMPILER_WARNING (CWE-563):
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'configure_ips'
crun-HEAD/src/libcrun/net_device.c:259:22: warning[-Wunused-variable]: unused variable 'addr'
# 259 | struct sockaddr_nl addr = { .nl_family = AF_NETLINK };
# | ^~~~
# 257| {
# 258| struct ifaddrmsg *ifa;
# 259|-> struct sockaddr_nl addr = { .nl_family = AF_NETLINK };
# 260| struct ip_addr *ip;
# 261| struct nl_req *req = (struct nl_req *) buffer;
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/src/libcrun/net_device.c:23: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'move_network_device'
crun-HEAD/src/libcrun/utils.h:65:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(8192)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
# 63| {
# 64| void *res = malloc (size);
# 65|-> if (UNLIKELY (res == NULL))
# 66| OOM ();
# 67| return res;
Error: GCC_ANALYZER_WARNING (CWE-401):
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;
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'get_ip_addresses'
crun-HEAD/src/libcrun/utils.h:83:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(ips, ips_len + new_size + 12)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:24: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
# 81| {
# 82| void *res = realloc (ptr, size);
# 83|-> if (UNLIKELY (res == NULL))
# 84| OOM ();
# 85| return res;
Error: GCC_ANALYZER_WARNING (CWE-415):
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'ips'
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'get_ip_addresses'
# 90| {
# 91| void **pp = (void **) p;
# 92|-> free (*pp);
# 93| }
# 94|
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sock'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 106| int *pp = (int *) p;
# 107| if (*pp >= 0)
# 108|-> TEMP_FAILURE_RETRY (close (*pp));
# 109| }
# 110|
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sock_in_ns'
crun-HEAD/src/libcrun/net_device.c:392:3: note: in expansion of macro 'REQ_SET_LINK_STATE'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 106| int *pp = (int *) p;
# 107| if (*pp >= 0)
# 108|-> TEMP_FAILURE_RETRY (close (*pp));
# 109| }
# 110|