Task #76 - iproute-6.8.0-1.fc41/scan-results.err
back to task #76download
Error: CLANG_WARNING: iproute2-6.8.0/bridge/mdb.c:264:6: warning[core.NullDereference]: Array access (from variable 'tb') results in a null pointer dereference # 262| print_uint(PRINT_ANY, "vid", " vid %u", e->vid); # 263| # 264|-> if (tb[MDBA_MDB_EATTR_DST]) # 265| print_dst(tb[MDBA_MDB_EATTR_DST]); # 266| Error: CPPCHECK_WARNING (CWE-476): iproute2-6.8.0/devlink/devlink.c:2762: error[ctunullpointer]: Null pointer dereference: dl # 2760| snprintf(buf, sizeof(buf), "%s/%s", bus_name, dev_name); # 2761| # 2762|-> if (dl->json_output) { # 2763| if (array) { # 2764| if (should_arr_last_handle_end(dl, bus_name, dev_name)) Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:3497: error[uninitvar]: Uninitialized variables: param_value_attr.nla_len, param_value_attr.nla_type # 3495| nla_param[DEVLINK_ATTR_PARAM_VALUES_LIST]) { # 3496| pr_out_entry_start(dl); # 3497|-> pr_out_param_value(dl, nla_name, nla_type, param_value_attr); # 3498| pr_out_entry_end(dl); # 3499| } Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:7392: error[uninitvar]: Uninitialized variables: nla_field.nla_len, nla_field.nla_type # 7390| # 7391| mnl_attr_for_each_nested(nla_field, nla_fields) { # 7392|-> err = dpipe_header_field_get(nla_field, &fields[count]); # 7393| if (err) # 7394| return err; Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:7458: error[uninitvar]: Uninitialized variables: nla_header.nla_len, nla_header.nla_type # 7456| # 7457| mnl_attr_for_each_nested(nla_header, nla_headers) { # 7458|-> err = dpipe_header_get(ctx, nla_header); # 7459| if (err) # 7460| return err; Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:7617: error[uninitvar]: Uninitialized variables: nla_action.nla_len, nla_action.nla_type # 7615| mnl_attr_for_each_nested(nla_action, nla_actions) { # 7616| pr_out_entry_start(ctx->dl); # 7617|-> if (dpipe_action_parse(&action, nla_action)) # 7618| goto err_action_parse; # 7619| pr_out_dpipe_action(&action, ctx); Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:7702: error[uninitvar]: Uninitialized variables: nla_match.nla_len, nla_match.nla_type # 7700| mnl_attr_for_each_nested(nla_match, nla_matches) { # 7701| pr_out_entry_start(ctx->dl); # 7702|-> if (dpipe_match_parse(&match, nla_match)) # 7703| goto err_match_parse; # 7704| pr_out_dpipe_match(&match, ctx); Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:7855: error[uninitvar]: Uninitialized variables: nla_table.nla_len, nla_table.nla_type # 7853| if (ctx->print_tables) # 7854| pr_out_handle_start_arr(ctx->dl, tb); # 7855|-> if (dpipe_table_show(ctx, nla_table)) # 7856| goto err_table_show; # 7857| if (ctx->print_tables) Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:8214: error[uninitvar]: Uninitialized variables: nla_action_value.nla_len, nla_action_value.nla_type # 8212| # 8213| mnl_attr_for_each_nested(nla_action_value, nla_action_values) { # 8214|-> if (dpipe_entry_action_value_show(ctx, nla_action_value)) # 8215| return -EINVAL; # 8216| } Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:8227: error[uninitvar]: Uninitialized variables: nla_match_value.nla_len, nla_match_value.nla_type # 8225| # 8226| mnl_attr_for_each_nested(nla_match_value, nla_match_values) { # 8227|-> if (dpipe_entry_match_value_show(ctx, nla_match_value)) # 8228| return -EINVAL; # 8229| } Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:8285: error[uninitvar]: Uninitialized variables: nla_entry.nla_len, nla_entry.nla_type # 8283| mnl_attr_for_each_nested(nla_entry, nla_entries) { # 8284| pr_out_handle_start_arr(ctx->dl, tb); # 8285|-> if (dpipe_entry_show(ctx, nla_entry)) # 8286| goto err_entry_show; # 8287| pr_out_handle_end(ctx->dl); Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/devlink/devlink.c:9686: error[uninitvar]: Uninitialized variables: attr_metadata.nla_len, attr_metadata.nla_type # 9684| check_indent_newline(dl); # 9685| print_string(PRINT_ANY, NULL, "%s", # 9686|-> trap_metadata_name(attr_metadata)); # 9687| } # 9688| pr_out_array_end(dl); Error: CLANG_WARNING: iproute2-6.8.0/devlink/mnlg.c:96:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 94| struct group_info *group_info = data; # 95| struct nlattr *tb[CTRL_ATTR_MAX + 1] = {}; # 96|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 97| # 98| mnl_attr_parse(nlh, sizeof(*genl), get_group_id_attr_cb, tb); Error: CLANG_WARNING: iproute2-6.8.0/lib/bpf_legacy.c:41: included_from: Included from here. iproute2-6.8.0/include/bpf_util.h:20: included_from: Included from here. iproute2-6.8.0/include/bpf_scm.h:74:17: warning[core.NullDereference]: Access to field 'cmsg_len' results in a dereference of a null pointer (loaded from variable 'cmsg') # 72| # 73| cmsg = CMSG_FIRSTHDR(&msg->hdr); # 74|-> cmsg->cmsg_len = msg->hdr.msg_controllen; # 75| } # 76| Error: GCC_ANALYZER_WARNING (CWE-457): iproute2-6.8.0/tc/m_gate.c: scope_hint: In function ‘free_entries’ iproute2-6.8.0/include/list.h:9:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*n.list.next’ iproute2-6.8.0/include/list.h:54:9: note: in expansion of macro ‘container_of’ iproute2-6.8.0/include/list.h:63:9: note: in expansion of macro ‘list_entry’ iproute2-6.8.0/include/list.h:77:27: note: in expansion of macro ‘list_next_entry’ iproute2-6.8.0/tc/m_gate.c:132:9: note: in expansion of macro ‘list_for_each_entry_safe’ iproute2-6.8.0/tc/m_gate.c:160:9: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/m_gate.c:160:9: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/m_gate.c: scope_hint: In function ‘free_entries’ iproute2-6.8.0/tc/m_gate.c:132:9: note: in expansion of macro ‘list_for_each_entry_safe’ iproute2-6.8.0/tc/m_gate.c: scope_hint: In function ‘free_entries’ iproute2-6.8.0/include/list.h:54:9: note: in expansion of macro ‘container_of’ iproute2-6.8.0/include/list.h:63:9: note: in expansion of macro ‘list_entry’ iproute2-6.8.0/include/list.h:77:27: note: in expansion of macro ‘list_next_entry’ iproute2-6.8.0/tc/m_gate.c:132:9: note: in expansion of macro ‘list_for_each_entry_safe’ # 7| # 8| #define container_of(ptr, type, member) ({ \ # 9|-> const typeof( ((type *)0)->member ) *__mptr = (ptr); \ # 10| (type *)( (char *)__mptr - offsetof(type,member) );}) # 11| Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/include/list.h:29:20: warning[-Wanalyzer-malloc-leak]: leak of ‘create_entry(mask, interval, 0)’ iproute2-6.8.0/tc/q_taprio.c: scope_hint: In function ‘taprio_parse_opt’ iproute2-6.8.0/tc/q_taprio.c:20: included_from: Included from here. iproute2-6.8.0/tc/q_taprio.c:233:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/q_taprio.c:233:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/q_taprio.c: scope_hint: In function ‘taprio_parse_opt’ iproute2-6.8.0/tc/q_taprio.c:241:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/q_taprio.c:241:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/q_taprio.c:247:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/q_taprio.c:247:25: note: in expansion of macro ‘NEXT_ARG’ # 27| new->next = next; # 28| new->prev = prev; # 29|-> prev->next = new; # 30| } # 31| Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/include/list.h:29:20: warning[-Wanalyzer-malloc-leak]: leak of ‘create_gate_entry((int)gate_state, interval, ipv, maxoctets)’ iproute2-6.8.0/tc/m_gate.c: scope_hint: In function ‘parse_gate’ iproute2-6.8.0/tc/m_gate.c:9: included_from: Included from here. iproute2-6.8.0/tc/m_gate.c:160:9: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/m_gate.c:160:9: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/m_gate.c: scope_hint: In function ‘parse_gate’ iproute2-6.8.0/tc/m_gate.c:228:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/m_gate.c:244:25: note: in expansion of macro ‘NEXT_ARG’ # 27| new->next = next; # 28| new->prev = prev; # 29|-> prev->next = new; # 30| } # 31| Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/include/list.h:108:18: warning[-Wanalyzer-malloc-leak]: leak of ‘im’ iproute2-6.8.0/lib/ll_map.c: scope_hint: In function ‘ll_entry_create’ iproute2-6.8.0/include/list.h:117:35: note: in definition of macro ‘hlist_for_each’ iproute2-6.8.0/lib/ll_map.c:68:27: note: in expansion of macro ‘container_of’ iproute2-6.8.0/include/libnetlink.h:8: included_from: Included from here. iproute2-6.8.0/lib/ll_map.c:17: included_from: Included from here. iproute2-6.8.0/include/uapi/linux/if_link.h:397:25: note: in expansion of macro ‘NLMSG_PAYLOAD’ iproute2-6.8.0/lib/ll_map.c:239:28: note: in expansion of macro ‘IFLA_PAYLOAD’ iproute2-6.8.0/lib/ll_map.c: scope_hint: In function ‘ll_entry_create’ iproute2-6.8.0/include/libnetlink.h:9: included_from: Included from here. iproute2-6.8.0/lib/ll_map.c:137:15: note: in expansion of macro ‘RTA_PAYLOAD’ iproute2-6.8.0/lib/ll_map.c:138:38: note: in expansion of macro ‘RTA_OK’ iproute2-6.8.0/lib/ll_map.c: scope_hint: In function ‘ll_entry_create’ # 106| first->pprev = &n->next; # 107| h->first = n; # 108|-> n->pprev = &h->first; # 109| } # 110| Error: CLANG_WARNING: iproute2-6.8.0/ip/ipaddress.c:2027:2: warning[core.StackAddressEscape]: Address of stack memory associated with local variable 'flushb' is still referred to by the global variable 'filter' upon returning to the caller. This will be a dangling reference # 2025| fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", max_flush_loops); # 2026| fflush(stderr); # 2027|-> return 1; # 2028| } # 2029| Error: CLANG_WARNING: iproute2-6.8.0/ip/ipaddress.c:2613:4: warning[deadcode.DeadStores]: Value stored to 'brd_len' is never read # 2611| } # 2612| addattr_l(&req.n, sizeof(req), IFA_BROADCAST, &brd.data, brd.bytelen); # 2613|-> brd_len = brd.bytelen; # 2614| } # 2615| } Error: CLANG_WARNING: iproute2-6.8.0/ip/iplink.c:497:4: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 495| # 496| if (tivt.min_tx_rate == -1 || tivt.max_tx_rate == -1) { # 497|-> ipaddr_get_vf_rate(tivt.vf, &tmin, &tmax, dev); # 498| if (tivt.min_tx_rate == -1) # 499| tivt.min_tx_rate = tmin; Error: GCC_ANALYZER_WARNING (CWE-457): iproute2-6.8.0/ip/iplink.c: scope_hint: In function ‘iplink_parse_vf’ iproute2-6.8.0/ip/iplink.c:497:48: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘tivt.vf’ iproute2-6.8.0/ip/iplink.c:27: included_from: Included from here. iproute2-6.8.0/ip/iplink.c:555:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/ip/iplink.c:696:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/ip/iplink.c:696:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/ip/iplink.c:333:16: note: in expansion of macro ‘NEXT_ARG_OK’ iproute2-6.8.0/ip/iplink.c:334:17: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/ip/iplink.c:391:25: note: in expansion of macro ‘NEXT_ARG’ # 495| # 496| if (tivt.min_tx_rate == -1 || tivt.max_tx_rate == -1) { # 497|-> ipaddr_get_vf_rate(tivt.vf, &tmin, &tmax, dev); # 498| if (tivt.min_tx_rate == -1) # 499| tivt.min_tx_rate = tmin; Error: CLANG_WARNING: iproute2-6.8.0/ip/iplink_bond.c:836:14: warning[deadcode.DeadStores]: Value stored to 'ifname' during its initialization is never read # 834| struct rtattr *bondtb[LINK_XSTATS_TYPE_MAX+1]; # 835| struct rtattr *i, *list; # 836|-> const char *ifname = ""; # 837| int rem; # 838| Error: CLANG_WARNING: iproute2-6.8.0/ip/iplink_bridge.c:888:14: warning[deadcode.DeadStores]: Value stored to 'ifname' during its initialization is never read # 886| struct rtattr *brtb[LINK_XSTATS_TYPE_MAX+1]; # 887| struct rtattr *i, *list; # 888|-> const char *ifname = ""; # 889| int rem; # 890| Error: CPPCHECK_WARNING (CWE-401): iproute2-6.8.0/ip/ipnetns.c:186: error[memleak]: Memory leak: c # 184| hlist_add_head(&c->name_hash, &name_head[h]); # 185| # 186|-> return 0; # 187| } # 188| Error: GCC_ANALYZER_WARNING (CWE-476): iproute2-6.8.0/ip/iproute_lwtunnel.c: scope_hint: In function ‘parse_encap_rpl’ iproute2-6.8.0/ip/iproute_lwtunnel.c:1066:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parse_rpl_srh(&segbuf)’ # 1064| # 1065| srh = parse_rpl_srh(segbuf); # 1066|-> srhlen = (srh->hdrlen + 1) << 3; # 1067| # 1068| if (rta_addattr_l(rta, len, RPL_IPTUNNEL_SRH, srh, Error: CLANG_WARNING: iproute2-6.8.0/ip/iproute_lwtunnel.c:1361:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 1359| if (get_u8(&lbl, *argv, 0)) # 1360| invarg("\"locator-block length\" value is invalid\n", *argv); # 1361|-> ret = rta_addattr8(rta, len, SEG6_LOCAL_FLV_LCBLOCK_BITS, lbl); # 1362| NEXT_ARG_FWD(); # 1363| } Error: CLANG_WARNING: iproute2-6.8.0/ip/iproute_lwtunnel.c:1371:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 1369| if (get_u8(&nfl, *argv, 0)) # 1370| invarg("\"locator-node function length\" value is invalid\n", *argv); # 1371|-> ret = rta_addattr8(rta, len, SEG6_LOCAL_FLV_LCNODE_FN_BITS, nfl); # 1372| NEXT_ARG_FWD(); # 1373| } Error: GCC_ANALYZER_WARNING (CWE-775): iproute2-6.8.0/ip/rtmon.c: scope_hint: In function ‘main’ iproute2-6.8.0/ip/rtmon.c:158:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "w")’ # 156| } # 157| # 158|-> if (rtnl_open(&rth, groups) < 0) # 159| exit(1); # 160| Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/ip/rtmon.c:158:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "w")’ # 156| } # 157| # 158|-> if (rtnl_open(&rth, groups) < 0) # 159| exit(1); # 160| Error: GCC_ANALYZER_WARNING (CWE-775): iproute2-6.8.0/ip/rtmon.c:161:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "w")’ # 159| exit(1); # 160| # 161|-> if (rtnl_linkdump_req(&rth, AF_UNSPEC) < 0) { # 162| perror("Cannot send dump request"); # 163| exit(1); Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/ip/rtmon.c:161:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "w")’ # 159| exit(1); # 160| # 161|-> if (rtnl_linkdump_req(&rth, AF_UNSPEC) < 0) { # 162| perror("Cannot send dump request"); # 163| exit(1); Error: CLANG_WARNING: iproute2-6.8.0/ip/xfrm_policy.c:562:26: warning[core.NullDereference]: Access to field 'hard' results in a dereference of a null pointer (loaded from variable 'xpexp') # 560| if (n->nlmsg_type == XFRM_MSG_POLEXPIRE) { # 561| fprintf(fp, "\t"); # 562|-> fprintf(fp, "hard %u", xpexp->hard); # 563| fprintf(fp, "%s", _SL_); # 564| } Error: CLANG_WARNING: iproute2-6.8.0/ip/xfrm_state.c:1015:26: warning[core.NullDereference]: Access to field 'hard' results in a dereference of a null pointer (loaded from variable 'xexp') # 1013| if (n->nlmsg_type == XFRM_MSG_EXPIRE) { # 1014| fprintf(fp, "\t"); # 1015|-> fprintf(fp, "hard %u", xexp->hard); # 1016| fprintf(fp, "%s", _SL_); # 1017| } Error: CLANG_WARNING: iproute2-6.8.0/lib/bpf_legacy.c:1255:9: warning[unix.Malloc]: Use of memory allocated with size zero # 1253| return -ENOMEM; # 1254| # 1255|-> ptr[0] = 0; # 1256| ctx->log = ptr; # 1257| ctx->log_size = log_size; Error: CLANG_WARNING: iproute2-6.8.0/lib/bpf_legacy.c:2934:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 2932| bpf_hash_init(ctx, CONF_ETC_DIR "/bpf_pinning"); # 2933| if (ret == -ENOENT) # 2934|-> ret = bpf_hash_init(ctx, CONF_USR_DIR "/bpf_pinning"); # 2935| # 2936| return 0; Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/lib/cg_map.c: scope_hint: In function ‘cg_id_to_path’ iproute2-6.8.0/lib/cg_map.c:47:29: warning[-Wanalyzer-malloc-leak]: leak of ‘cg_entry_create(id, get_cgroup2_path(id, 0))’ iproute2-6.8.0/include/list.h:117:35: note: in definition of macro ‘hlist_for_each’ iproute2-6.8.0/lib/cg_map.c: scope_hint: In function ‘cg_id_to_path’ iproute2-6.8.0/lib/cg_map.c: scope_hint: In function ‘cg_id_to_path’ # 45| static struct cg_cache *cg_entry_create(__u64 id, const char *path) # 46| { # 47|-> unsigned int h = id & (IDMAP_SIZE - 1); # 48| struct cg_cache *cg; # 49| Error: CLANG_WARNING: iproute2-6.8.0/lib/libnetlink.c:1047:4: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1045| } # 1046| for (h = (struct nlmsghdr *)buf; status >= sizeof(*h); ) { # 1047|-> int len = h->nlmsg_len; # 1048| int l = len - sizeof(*h); # 1049| Error: CLANG_WARNING: iproute2-6.8.0/lib/mnl_utils.c:144:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 142| static int get_family_cb(const struct nlmsghdr *nlh, void *data) # 143| { # 144|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 145| struct nlattr *tb[CTRL_ATTR_MAX + 1] = {}; # 146| struct mnlu_gen_socket *nlg = data; Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/lib/mnl_utils.c:303: error[uninitvar]: Uninitialized variable: attr->nla_type # 301| # 302| mnl_attr_for_each_nested(attr, op_policy_nest) { # 303|-> if (ctx->cmd != (attr->nla_type & ~NLA_F_NESTED)) # 304| continue; # 305| err = mnl_attr_parse_nested(attr, ctrl_policy_attrs_cb, tb); Error: CLANG_WARNING: iproute2-6.8.0/lib/mnl_utils.c:335:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 333| static int cmd_dump_policy_cb(const struct nlmsghdr *nlh, void *data) # 334| { # 335|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 336| struct nlattr *tb[CTRL_ATTR_MAX + 1] = {}; # 337| struct cmd_dump_policy_ctx *ctx = data; Error: CLANG_WARNING: iproute2-6.8.0/lib/rt_names.c:314:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 312| ARRAY_SIZE(rtnl_addrprot_tab)); # 313| if (ret == -ENOENT) # 314|-> ret = rtnl_tab_initialize(CONF_USR_DIR "/rt_addrprotos", # 315| rtnl_addrprot_tab, # 316| ARRAY_SIZE(rtnl_addrprot_tab)); Error: CLANG_WARNING: iproute2-6.8.0/lib/utils.c:957:10: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 955| # 956| if (getenv("HZ")) # 957|-> return atoi(getenv("HZ")) ? : HZ; # 958| # 959| if (getenv("PROC_NET_PSCHED")) Error: CLANG_WARNING: iproute2-6.8.0/lib/utils.c:1744:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'line' # 1742| } # 1743| # 1744|-> free(line); # 1745| # 1746| return ret; Error: GCC_ANALYZER_WARNING (CWE-121): iproute2-6.8.0/misc/ifstat.c: scope_hint: In function ‘main’ iproute2-6.8.0/misc/ifstat.c:896:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow iproute2-6.8.0/misc/ifstat.c:896:9: note: write of 1 byte to beyond the end of ‘sun’ # 894| sun.sun_family = AF_UNIX; # 895| sun.sun_path[0] = 0; # 896|-> sprintf(sun.sun_path+1, "ifstat%d", getuid()); # 897| # 898| if (scan_interval > 0) { Error: CLANG_WARNING: iproute2-6.8.0/misc/ifstat.c:1031:17: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1029| # 1030| if (!no_update) { # 1031|-> if (ftruncate(fileno(hist_fp), 0)) # 1032| perror("ifstat: ftruncate"); # 1033| rewind(hist_fp); Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/misc/lnstat.c: scope_hint: In function ‘main’ iproute2-6.8.0/misc/lnstat.c:297:31: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’ # 295| break; # 296| case 'k': # 297|-> tmp = strdup(optarg); # 298| if (!tmp) # 299| break; Error: CLANG_WARNING: iproute2-6.8.0/misc/lnstat.c:300:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'tmp' # 298| if (!tmp) # 299| break; # 300|-> for (tok = strtok(tmp, ","); # 301| tok; # 302| tok = strtok(NULL, ",")) { Error: GCC_ANALYZER_WARNING (CWE-688): iproute2-6.8.0/misc/lnstat_util.c: scope_hint: In function ‘__lnstat_scan_fields’ iproute2-6.8.0/misc/lnstat_util.c:120:17: warning[-Wanalyzer-null-argument]: use of NULL ‘tok’ where non-null expected <built-in>: note: argument 2 of ‘__builtin_strncpy’ must be non-null # 118| for (i = 0; i < LNSTAT_MAX_FIELDS_PER_LINE; i++) { # 119| lf->fields[i].file = lf; # 120|-> strncpy(lf->fields[i].name, tok, LNSTAT_MAX_FIELD_NAME_LEN); # 121| /* has to be null-terminate since we initialize to zero # 122| * and field size is NAME_LEN + 1 */ Error: GCC_ANALYZER_WARNING (CWE-775): iproute2-6.8.0/misc/lnstat_util.c:123:23: warning[-Wanalyzer-file-leak]: leak of FILE # 121| /* has to be null-terminate since we initialize to zero # 122| * and field size is NAME_LEN + 1 */ # 123|-> tok = strtok(NULL, " \t\n"); # 124| if (!tok) { # 125| lf->num_fields = i+1; Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/misc/lnstat_util.c:123:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 121| /* has to be null-terminate since we initialize to zero # 122| * and field size is NAME_LEN + 1 */ # 123|-> tok = strtok(NULL, " \t\n"); # 124| if (!tok) { # 125| lf->num_fields = i+1; Error: CLANG_WARNING: iproute2-6.8.0/misc/nstat.c:186:10: warning[deadcode.DeadStores]: Although the value stored to 'nread' is used in the enclosing expression, the value is never actually read from 'nread' # 184| struct nstat_ent *n; # 185| # 186|-> while ((nread = getline(&buf, &buflen, fp)) != -1) { # 187| char idbuf[4096]; # 188| int off; Error: CLANG_WARNING: iproute2-6.8.0/misc/nstat.c:201:23: warning[unix.cstring.BadSizeArg]: Potential buffer overflow. Replace with 'sizeof(idbuf) - strlen(idbuf) - 1' or use a safer 'strlcat' API # 199| *p = 0; # 200| idbuf[0] = 0; # 201|-> strncat(idbuf, buf, sizeof(idbuf) - 1); # 202| off = p - buf; # 203| p += 2; Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/misc/nstat.c: scope_hint: In function ‘load_ugly_table’ iproute2-6.8.0/misc/nstat.c:235:20: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ iproute2-6.8.0/misc/nstat.c: scope_hint: In function ‘load_ugly_table’ # 233| n = db; # 234| nread = getline(&buf, &buflen, fp); # 235|-> if (nread == -1) { # 236| fprintf(stderr, "%s:%d: error parsing history file\n", # 237| __FILE__, __LINE__); Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/misc/nstat.c:245:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ iproute2-6.8.0/misc/nstat.c: scope_hint: In function ‘load_ugly_table’ iproute2-6.8.0/misc/nstat.c: scope_hint: In function ‘load_ugly_table’ # 243| do { # 244| p = strrchr(buf, ' '); # 245|-> if (!p) { # 246| fprintf(stderr, "%s:%d: error parsing history file\n", # 247| __FILE__, __LINE__); Error: CLANG_WARNING: iproute2-6.8.0/misc/nstat.c:260:9: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'n') # 258| skip--; # 259| else # 260|-> n = n->next; # 261| } while (p > buf + off + 2); # 262| } Error: GCC_ANALYZER_WARNING (CWE-476): iproute2-6.8.0/misc/nstat.c:260:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘n’ iproute2-6.8.0/misc/nstat.c: scope_hint: In function ‘load_ugly_table’ # 258| skip--; # 259| else # 260|-> n = n->next; # 261| } while (p > buf + off + 2); # 262| } Error: GCC_ANALYZER_WARNING (CWE-121): iproute2-6.8.0/misc/nstat.c: scope_hint: In function ‘main’ iproute2-6.8.0/misc/nstat.c:639:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow iproute2-6.8.0/misc/nstat.c:639:9: note: write of 1 byte to beyond the end of ‘sun’ # 637| sun.sun_family = AF_UNIX; # 638| sun.sun_path[0] = 0; # 639|-> sprintf(sun.sun_path+1, "nstat%d", getuid()); # 640| # 641| if (scan_interval > 0) { Error: CLANG_WARNING: iproute2-6.8.0/misc/nstat.c:767:17: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 765| } # 766| if (!no_update) { # 767|-> if (ftruncate(fileno(hist_fp), 0) < 0) # 768| perror("nstat: ftruncate"); # 769| rewind(hist_fp); Error: GCC_ANALYZER_WARNING (CWE-121): iproute2-6.8.0/misc/rtacct.c: scope_hint: In function ‘main’ iproute2-6.8.0/misc/rtacct.c:498:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow iproute2-6.8.0/misc/rtacct.c:498:9: note: write of 1 byte to beyond the end of ‘sun’ # 496| sun.sun_family = AF_UNIX; # 497| sun.sun_path[0] = 0; # 498|-> sprintf(sun.sun_path+1, "rtacct%d", getuid()); # 499| # 500| if (scan_interval > 0) { Error: CLANG_WARNING: iproute2-6.8.0/misc/ss.c:561:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'task_context' # 559| if (!dir) { # 560| freecon(task_context); # 561|-> return; # 562| } # 563| Error: CLANG_WARNING: iproute2-6.8.0/misc/ss.c:566:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'sock_context' # 564| pos_fd = strlen(path); /* $PROC_ROOT/$ID/fd/ */ # 565| # 566|-> while ((d = readdir(dir)) != NULL) { # 567| const char *pattern = "socket:["; # 568| char *sock_context; Error: CLANG_WARNING: iproute2-6.8.0/misc/ss.c:2376:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'a.next' # 2374| if (res) # 2375| memcpy(res, &a, sizeof(a)); # 2376|-> return res; # 2377| } # 2378| Error: CLANG_WARNING: iproute2-6.8.0/misc/ss.c:3566:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'bc' # 3564| # 3565| msg = (struct msghdr) { # 3566|-> .msg_name = (void *)&nladdr, # 3567| .msg_namelen = sizeof(nladdr), # 3568| .msg_iov = iov, Error: CLANG_WARNING: iproute2-6.8.0/misc/ss.c:5679:8: warning[deadcode.DeadStores]: Although the value stored to 'p1' is used in the enclosing expression, the value is never actually read from 'p1' # 5677| do_default = 0; # 5678| } # 5679|-> p = p1 = optarg; # 5680| do { # 5681| if ((p1 = strchr(p, ',')) != NULL) Error: GCC_ANALYZER_WARNING (CWE-457): iproute2-6.8.0/misc/ssfilter.tab.c: scope_hint: In function ‘yyparse’ iproute2-6.8.0/misc/ssfilter.tab.c:537:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’ iproute2-6.8.0/misc/ssfilter.tab.c:522:9: note: in expansion of macro ‘YYCOPY’ iproute2-6.8.0/misc/ssfilter.tab.c:1085:9: note: in expansion of macro ‘YYSTACK_RELOCATE’ iproute2-6.8.0/misc/ssfilter.tab.c:522:9: note: in expansion of macro ‘YYCOPY’ iproute2-6.8.0/misc/ssfilter.tab.c:1085:9: note: in expansion of macro ‘YYSTACK_RELOCATE’ iproute2-6.8.0/misc/ssfilter.tab.c:522:9: note: in expansion of macro ‘YYCOPY’ iproute2-6.8.0/misc/ssfilter.tab.c:1085:9: note: in expansion of macro ‘YYSTACK_RELOCATE’ # 535| # if defined __GNUC__ && 1 < __GNUC__ # 536| # define YYCOPY(Dst, Src, Count) \ # 537|-> __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # 538| # else # 539| # define YYCOPY(Dst, Src, Count) \ Error: GCC_ANALYZER_WARNING (CWE-457): iproute2-6.8.0/misc/ssfilter.tab.c:1212:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’ # 1210| unconditionally makes the parser a bit smaller, and it avoids a # 1211| GCC warning that YYVAL may be used uninitialized. */ # 1212|-> yyval = yyvsp[1-yylen]; # 1213| # 1214| Error: GCC_ANALYZER_WARNING (CWE-476): iproute2-6.8.0/netem/maketable.c: scope_hint: In function ‘inverttable’ iproute2-6.8.0/netem/maketable.c:144:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘inverse’ # 142| inverse = (short *)malloc(inversesize*sizeof(short)); # 143| for (i=0; i < inversesize; ++i) { # 144|-> inverse[i] = MINSHORT; # 145| } # 146| for (i=0; i < tablesize; ++i) { Error: CLANG_WARNING: iproute2-6.8.0/netem/normal.c:40:34: warning[core.UndefinedBinaryOperatorResult]: The left operand of '*' is a garbage value # 38| printf("# This is the distribution table for the normal distribution.\n"); # 39| for (i = n = 0; i < TABLESIZE; i += 4) { # 40|-> int value = (int) rint(table[i]*TABLEFACTOR); # 41| if (value < SHRT_MIN) value = SHRT_MIN; # 42| if (value > SHRT_MAX) value = SHRT_MAX; Error: CLANG_WARNING: iproute2-6.8.0/netem/paretonormal.c:67:34: warning[core.UndefinedBinaryOperatorResult]: The left operand of '*' is a garbage value # 65| int normvalue, parvalue, value; # 66| # 67|-> normvalue = (int) rint(table[i]*TABLEFACTOR); # 68| parvalue = paretovalue(i); # 69| Error: CLANG_WARNING: iproute2-6.8.0/rdma/res-cmid.c:144:6: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value # 142| nla_line[RDMA_NLDEV_ATTR_RES_SRC_ADDR])) # 143| goto out; # 144|-> if (rd_is_filtered_attr(rd, "src-port", src_port, # 145| nla_line[RDMA_NLDEV_ATTR_RES_SRC_ADDR])) # 146| goto out; Error: CLANG_WARNING: iproute2-6.8.0/rdma/res-cmid.c:155:6: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value # 153| nla_line[RDMA_NLDEV_ATTR_RES_DST_ADDR])) # 154| goto out; # 155|-> if (rd_is_filtered_attr(rd, "dst-port", dst_port, # 156| nla_line[RDMA_NLDEV_ATTR_RES_DST_ADDR])) # 157| goto out; Error: GCC_ANALYZER_WARNING (CWE-688): iproute2-6.8.0/rdma/stat.c: scope_hint: In function ‘stat_get_arg_str’ iproute2-6.8.0/rdma/stat.c:521:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*value’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 519| if (!rd_no_arg(rd)) { # 520| *value = strdup(rd_argv(rd)); # 521|-> len = strlen(*value); # 522| rd_arg_inc(rd); # 523| } Error: GCC_ANALYZER_WARNING (CWE-688): iproute2-6.8.0/rdma/stat.c:521:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘opcnts’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 519| if (!rd_no_arg(rd)) { # 520| *value = strdup(rd_argv(rd)); # 521|-> len = strlen(*value); # 522| rd_arg_inc(rd); # 523| } Error: CLANG_WARNING: iproute2-6.8.0/rdma/stat.c:936:8: warning[unix.Malloc]: Potential leak of memory pointed to by 'opcnts' # 934| tb_set = mnl_attr_nest_start(rd->nlh, RDMA_NLDEV_ATTR_STAT_HWCOUNTERS); # 935| # 936|-> opcnt = strtok(opcnts, ","); # 937| while (opcnt) { # 938| found = false; Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/rdma/stat.c: scope_hint: In function ‘stat_one_unset_link_opcounters’ iproute2-6.8.0/rdma/stat.c:1013:24: warning[-Wanalyzer-malloc-leak]: leak of ‘opcnts’ # 1011| if (rd_no_arg(rd)) { # 1012| stat_help(rd); # 1013|-> return -EINVAL; # 1014| } # 1015| Error: CLANG_WARNING: iproute2-6.8.0/rdma/stat.c:1016:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'opcnts' # 1014| } # 1015| # 1016|-> ret = stat_get_arg_str(rd, "optional-counters", &opcnts, true); # 1017| if (ret) # 1018| return ret; Error: GCC_ANALYZER_WARNING (CWE-688): iproute2-6.8.0/rdma/utils.c: scope_hint: In function ‘get_port_from_argv’ iproute2-6.8.0/rdma/utils.c:76:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected iproute2-6.8.0/rdma/utils.c: scope_hint: In function ‘get_port_from_argv’ <built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null # 74| *is_dump_all = strict_port ? false : true; # 75| # 76|-> slash = strchr(rd_argv(rd), '/'); # 77| /* if no port found, return 0 */ # 78| if (slash == NULL) { Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/rdma/utils.c:939: error[uninitvar]: Uninitialized variables: tb_entry.nla_len, tb_entry.nla_type # 937| cc = 0; # 938| } # 939|-> if (rd_attr_check(tb_entry, &type) != MNL_CB_OK) # 940| return; # 941| if (!key) { Error: GCC_ANALYZER_WARNING (CWE-476): iproute2-6.8.0/tc/em_canid.c: scope_hint: In function ‘canid_parse_rule’ iproute2-6.8.0/tc/em_canid.c:77:51: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rules.rules_raw’ iproute2-6.8.0/tc/em_canid.c:27: included_from: Included from here. iproute2-6.8.0/tc/em_canid.c: scope_hint: In function ‘canid_parse_rule’ # 75| } # 76| # 77|-> rules->rules_raw[rules->rules_cnt].can_id = # 78| can_id | ((iseff) ? CAN_EFF_FLAG : 0); # 79| rules->rules_raw[rules->rules_cnt].can_mask = Error: CLANG_WARNING: iproute2-6.8.0/tc/em_meta.c:158:32: warning[core.NullDereference]: Access to field 'data' results in a dereference of a null pointer (loaded from variable 'a') # 156| struct bstr *a = (struct bstr *) val; # 157| # 158|-> addattr_l(n, MAX_MSG, tlv, a->data, a->len); # 159| } # 160| break; Error: CPPCHECK_WARNING (CWE-401): iproute2-6.8.0/tc/emp_ematch.l:47: error[memleakOnRealloc]: Common realloc mistake: 'strbuf' nulled but not freed upon failure # 45| { # 46| strbuf_size += 512; # 47|-> strbuf = realloc(strbuf, strbuf_size); # 48| } # 49| Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/tc/emp_ematch.lex.c: scope_hint: In function ‘yy_get_next_buffer’ iproute2-6.8.0/tc/emp_ematch.lex.c:1457:18: warning[-Wanalyzer-malloc-leak]: leak of ‘*b.yy_ch_buf’ iproute2-6.8.0/tc/emp_ematch.lex.c:1459:41: note: in expansion of macro ‘yyrealloc’ iproute2-6.8.0/tc/emp_ematch.lex.c: scope_hint: In function ‘yy_get_next_buffer’ iproute2-6.8.0/tc/emp_ematch.lex.c:1459:41: note: in expansion of macro ‘yyrealloc’ iproute2-6.8.0/tc/emp_ematch.lex.c: scope_hint: In function ‘yy_get_next_buffer’ Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/tc/emp_ematch.lex.c: scope_hint: In function ‘ematch__create_buffer’ iproute2-6.8.0/tc/emp_ematch.lex.c:1779:12: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’ iproute2-6.8.0/tc/emp_ematch.lex.c:1765:21: note: in expansion of macro ‘yy_create_buffer’ iproute2-6.8.0/tc/emp_ematch.lex.c:1769:24: note: in expansion of macro ‘yyalloc’ iproute2-6.8.0/tc/emp_ematch.lex.c: scope_hint: In function ‘ematch__create_buffer’ Error: CPPCHECK_WARNING (CWE-476): iproute2-6.8.0/tc/emp_ematch.lex.c:1819: warning[nullPointer]: Possible null pointer dereference: b Error: CPPCHECK_WARNING (CWE-476): iproute2-6.8.0/tc/emp_ematch.lex.c:1820: warning[nullPointer]: Possible null pointer dereference: b Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/tc/emp_ematch.lex.c: scope_hint: In function ‘ematch__scan_buffer’ iproute2-6.8.0/tc/emp_ematch.lex.c:2033:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’ iproute2-6.8.0/tc/emp_ematch.lex.c:2017:17: note: in expansion of macro ‘yy_scan_bytes’ iproute2-6.8.0/tc/emp_ematch.lex.c:2026:24: note: in expansion of macro ‘yyalloc’ iproute2-6.8.0/tc/emp_ematch.lex.c: scope_hint: In function ‘ematch__scan_buffer’ iproute2-6.8.0/tc/emp_ematch.lex.c:2035:6: note: in expansion of macro ‘yy_scan_buffer’ iproute2-6.8.0/tc/emp_ematch.lex.c:1967:17: note: in expansion of macro ‘yy_scan_buffer’ Error: GCC_ANALYZER_WARNING (CWE-401): iproute2-6.8.0/tc/emp_ematch.tab.c: scope_hint: In function ‘ematch_parse’ iproute2-6.8.0/tc/emp_ematch.tab.c:390:21: warning[-Wanalyzer-malloc-leak]: leak of ‘yyptr’ iproute2-6.8.0/tc/emp_ematch.tab.c:93:40: note: in definition of macro ‘YY_CAST’ iproute2-6.8.0/tc/emp_ematch.tab.c:376:25: note: in expansion of macro ‘YYMALLOC’ iproute2-6.8.0/tc/emp_ematch.tab.c:958:20: note: in expansion of macro ‘YYSTACK_ALLOC’ iproute2-6.8.0/tc/emp_ematch.tab.c:680:7: note: in expansion of macro ‘yydebug’ iproute2-6.8.0/tc/emp_ematch.tab.c:1006:7: note: in expansion of macro ‘YYDPRINTF’ iproute2-6.8.0/tc/emp_ematch.tab.c:1028:17: note: in expansion of macro ‘YYTRANSLATE’ iproute2-6.8.0/tc/emp_ematch.tab.c:689:7: note: in expansion of macro ‘yydebug’ iproute2-6.8.0/tc/emp_ematch.tab.c:1052:3: note: in expansion of macro ‘YY_SYMBOL_PRINT’ iproute2-6.8.0/tc/emp_ematch.tab.c:93:40: note: in definition of macro ‘YY_CAST’ iproute2-6.8.0/tc/emp_ematch.tab.c:376:25: note: in expansion of macro ‘YYMALLOC’ iproute2-6.8.0/tc/emp_ematch.tab.c:958:20: note: in expansion of macro ‘YYSTACK_ALLOC’ iproute2-6.8.0/tc/emp_ematch.tab.c:435:9: note: in expansion of macro ‘YYCOPY’ iproute2-6.8.0/tc/emp_ematch.tab.c:961:9: note: in expansion of macro ‘YYSTACK_RELOCATE’ iproute2-6.8.0/tc/emp_ematch.tab.c:680:7: note: in expansion of macro ‘yydebug’ iproute2-6.8.0/tc/emp_ematch.tab.c:1006:7: note: in expansion of macro ‘YYDPRINTF’ iproute2-6.8.0/tc/emp_ematch.tab.c:689:7: note: in expansion of macro ‘yydebug’ iproute2-6.8.0/tc/emp_ematch.tab.c:1052:3: note: in expansion of macro ‘YY_SYMBOL_PRINT’ iproute2-6.8.0/tc/emp_ematch.tab.c:917:3: note: in expansion of macro ‘YY_STACK_PRINT’ iproute2-6.8.0/tc/emp_ematch.tab.c:93:40: note: in definition of macro ‘YY_CAST’ iproute2-6.8.0/tc/emp_ematch.tab.c:376:25: note: in expansion of macro ‘YYMALLOC’ iproute2-6.8.0/tc/emp_ematch.tab.c:958:20: note: in expansion of macro ‘YYSTACK_ALLOC’ # 388| # endif # 389| # ifndef YYMALLOC # 390|-> # define YYMALLOC malloc # 391| # if ! defined malloc && ! defined EXIT_SUCCESS # 392| void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ Error: GCC_ANALYZER_WARNING (CWE-457): iproute2-6.8.0/tc/emp_ematch.tab.c:450:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’ iproute2-6.8.0/tc/emp_ematch.tab.c:435:9: note: in expansion of macro ‘YYCOPY’ iproute2-6.8.0/tc/emp_ematch.tab.c:961:9: note: in expansion of macro ‘YYSTACK_RELOCATE’ iproute2-6.8.0/tc/emp_ematch.tab.c:435:9: note: in expansion of macro ‘YYCOPY’ iproute2-6.8.0/tc/emp_ematch.tab.c:961:9: note: in expansion of macro ‘YYSTACK_RELOCATE’ iproute2-6.8.0/tc/emp_ematch.tab.c:435:9: note: in expansion of macro ‘YYCOPY’ iproute2-6.8.0/tc/emp_ematch.tab.c:961:9: note: in expansion of macro ‘YYSTACK_RELOCATE’ # 448| # if defined __GNUC__ && 1 < __GNUC__ # 449| # define YYCOPY(Dst, Src, Count) \ # 450|-> __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # 451| # else # 452| # define YYCOPY(Dst, Src, Count) \ Error: GCC_ANALYZER_WARNING (CWE-124): iproute2-6.8.0/tc/f_flower.c: scope_hint: In function ‘flower_parse_enc_opts_geneve’ iproute2-6.8.0/tc/f_flower.c:1240:26: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite iproute2-6.8.0/tc/f_flower.c:21: included_from: Included from here. iproute2-6.8.0/tc/f_flower.c:2126:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/f_flower.c:2126:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/f_flower.c:1240:26: note: valid subscripts for ‘key’ are ‘[0]’ to ‘[65535]’ # 1238| token = strsep(&str, ","); # 1239| } # 1240|-> key[key_len - 1] = '\0'; # 1241| mask[mask_len - 1] = '\0'; # 1242| Error: GCC_ANALYZER_WARNING (CWE-124): iproute2-6.8.0/tc/f_flower.c:1241:28: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite iproute2-6.8.0/tc/f_flower.c:2126:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/f_flower.c:2126:25: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/f_flower.c:1241:28: note: valid subscripts for ‘mask’ are ‘[0]’ to ‘[65535]’ # 1239| } # 1240| key[key_len - 1] = '\0'; # 1241|-> mask[mask_len - 1] = '\0'; # 1242| # 1243| nest = addattr_nest(n, MAX_MSG, TCA_FLOWER_KEY_ENC_OPTS); Error: CLANG_WARNING: iproute2-6.8.0/tc/m_action.c:226:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 224| memset(k, 0, sizeof(k)); # 225| # 226|-> if (strcmp(*argv, "action") == 0) { # 227| argc--; # 228| argv++; Error: GCC_ANALYZER_WARNING (CWE-590): iproute2-6.8.0/tc/m_gate.c:134:17: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘e’ which points to memory on the stack iproute2-6.8.0/tc/m_gate.c:160:9: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/m_gate.c:160:9: note: in expansion of macro ‘NEXT_ARG’ iproute2-6.8.0/tc/m_gate.c: scope_hint: In function ‘free_entries’ iproute2-6.8.0/tc/m_gate.c:132:9: note: in expansion of macro ‘list_for_each_entry_safe’ iproute2-6.8.0/tc/m_gate.c: scope_hint: In function ‘free_entries’ # 132| list_for_each_entry_safe(e, n, gate_entries, list) { # 133| list_del(&e->list); # 134|-> free(e); # 135| } # 136| } Error: CLANG_WARNING: iproute2-6.8.0/tc/m_ife.c:294:3: warning[deadcode.DeadStores]: Value stored to 'has_optional' is never read # 292| # 293| if (tb[TCA_IFE_DMAC]) { # 294|-> has_optional = 1; # 295| print_string(PRINT_ANY, "dst", "dst %s ", # 296| ll_addr_n2a(RTA_DATA(tb[TCA_IFE_DMAC]), Error: CLANG_WARNING: iproute2-6.8.0/tc/m_ife.c:302:3: warning[deadcode.DeadStores]: Value stored to 'has_optional' is never read # 300| # 301| if (tb[TCA_IFE_SMAC]) { # 302|-> has_optional = 1; # 303| print_string(PRINT_ANY, "src", "src %s ", # 304| ll_addr_n2a(RTA_DATA(tb[TCA_IFE_SMAC]), Error: CLANG_WARNING: iproute2-6.8.0/tc/m_skbmod.c:193:3: warning[deadcode.DeadStores]: Value stored to 'has_optional' is never read # 191| # 192| if (tb[TCA_SKBMOD_DMAC]) { # 193|-> has_optional = 1; # 194| fprintf(f, "set dmac %s ", # 195| ll_addr_n2a(RTA_DATA(tb[TCA_SKBMOD_DMAC]), Error: CLANG_WARNING: iproute2-6.8.0/tc/m_skbmod.c:202:3: warning[deadcode.DeadStores]: Value stored to 'has_optional' is never read # 200| # 201| if (tb[TCA_SKBMOD_SMAC]) { # 202|-> has_optional = 1; # 203| fprintf(f, "set smac %s ", # 204| ll_addr_n2a(RTA_DATA(tb[TCA_SKBMOD_SMAC]), Error: CLANG_WARNING: iproute2-6.8.0/tc/q_netem.c:503:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'slot_dist_data' # 501| NEXT_ARG(); # 502| if (get_time64(&slot.dist_delay, *argv)) { # 503|-> explain1("slot delay"); # 504| return -1; # 505| } Error: CPPCHECK_WARNING (CWE-401): iproute2-6.8.0/tc/tc_class.c:174: error[memleak]: Memory leak: node # 172| else # 173| hlist_add_head(&node->hlist, &cls_list); # 174|-> } # 175| # 176| static void graph_indent(char *buf, struct graph_node *node, int is_newline, Error: CLANG_WARNING: iproute2-6.8.0/tipc/bearer.c:81:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 79| static int get_netid_cb(const struct nlmsghdr *nlh, void *data) # 80| { # 81|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 82| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 83| struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/bearer.c:440:8: warning[deadcode.DeadStores]: Although the value stored to 'opt' is used in the enclosing expression, the value is never actually read from 'opt' # 438| return -EINVAL; # 439| } # 440|-> if (!(opt = get_opt(opts, "name"))) { # 441| fprintf(stderr, "error, missing media name\n"); # 442| return -EINVAL; Error: CLANG_WARNING: iproute2-6.8.0/tipc/bearer.c:752:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 750| { # 751| struct sockaddr_storage *addr; # 752|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 753| struct nlattr *info[TIPC_NLA_UDP_MAX + 1] = {}; # 754| Error: CLANG_WARNING: iproute2-6.8.0/tipc/bearer.c:788:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 786| struct cb_data *cb_data = (struct cb_data *) data; # 787| struct sockaddr_storage *addr; # 788|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 789| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 790| struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/bearer.c:885:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 883| { # 884| int *prop = data; # 885|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 886| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 887| struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/bearer.c:948:8: warning[deadcode.DeadStores]: Although the value stored to 'opt' is used in the enclosing expression, the value is never actually read from 'opt' # 946| return -EINVAL; # 947| } # 948|-> if (!(opt = get_opt(opts, "name"))) { # 949| fprintf(stderr, "error, missing media name\n"); # 950| return -EINVAL; Error: CLANG_WARNING: iproute2-6.8.0/tipc/bearer.c:1068:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 1066| static int bearer_list_cb(const struct nlmsghdr *nlh, void *data) # 1067| { # 1068|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 1069| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 1070| struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:34:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 32| static int link_list_cb(const struct nlmsghdr *nlh, void *data) # 33| { # 34|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 35| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 36| struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:84:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 82| { # 83| int *prop = data; # 84|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 85| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 86| struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:182:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 180| int *prop = data; # 181| int prop_ratio = TIPC_NLA_PROP_BROADCAST_RATIO; # 182|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 183| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 184| struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:503:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 501| const char *name; # 502| const char *link = data; # 503|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 504| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 505| struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:805:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 803| static int link_mon_summary_cb(const struct nlmsghdr *nlh, void *data) # 804| { # 805|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 806| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 807| struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:937:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 935| static int link_mon_peer_list_cb(const struct nlmsghdr *nlh, void *data) # 936| { # 937|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 938| struct nlattr *attrs[TIPC_NLA_MON_PEER_MAX + 1] = {}; # 939| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:1023:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 1021| static int link_mon_list_cb(const struct nlmsghdr *nlh, void *data) # 1022| { # 1023|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 1024| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 1025| struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/link.c:1151:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 1149| static int link_mon_get_cb(const struct nlmsghdr *nlh, void *data) # 1150| { # 1151|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 1152| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 1153| struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/media.c:22:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 20| static int media_list_cb(const struct nlmsghdr *nlh, void *data) # 21| { # 22|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 23| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 24| struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/media.c:59:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 57| { # 58| int *prop = data; # 59|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 60| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 61| struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/nametable.c:26:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 24| { # 25| int *iteration = data; # 26|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 27| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 28| struct nlattr *attrs[TIPC_NLA_NAME_TABLE_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/node.c:116:2: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 114| close(sk); # 115| # 116|-> printf("%08x\n", addr.addr.id.node); # 117| return 0; # 118| } Error: CLANG_WARNING: iproute2-6.8.0/tipc/socket.c:25:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 23| static int publ_list_cb(const struct nlmsghdr *nlh, void *data) # 24| { # 25|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 26| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 27| struct nlattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/tipc/socket.c:74:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 72| static int sock_list_cb(const struct nlmsghdr *nlh, void *data) # 73| { # 74|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 75| struct nlattr *info[TIPC_NLA_MAX + 1] = {}; # 76| struct nlattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {}; Error: CLANG_WARNING: iproute2-6.8.0/vdpa/vdpa.c:591:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 589| static int cmd_mgmtdev_show_cb(const struct nlmsghdr *nlh, void *data) # 590| { # 591|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 592| struct nlattr *tb[VDPA_ATTR_MAX + 1] = {}; # 593| struct vdpa *vdpa = data; Error: CLANG_WARNING: iproute2-6.8.0/vdpa/vdpa.c:694:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 692| static int cmd_dev_show_cb(const struct nlmsghdr *nlh, void *data) # 693| { # 694|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 695| struct nlattr *tb[VDPA_ATTR_MAX + 1] = {}; # 696| struct vdpa *vdpa = data; Error: CLANG_WARNING: iproute2-6.8.0/vdpa/vdpa.c:821:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 819| static int cmd_dev_config_show_cb(const struct nlmsghdr *nlh, void *data) # 820| { # 821|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 822| struct nlattr *tb[VDPA_ATTR_MAX + 1] = {}; # 823| struct vdpa *vdpa = data; Error: CPPCHECK_WARNING (CWE-457): iproute2-6.8.0/vdpa/vdpa.c:910: error[uninitvar]: Uninitialized variable: attr->nla_type # 908| # 909| mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) { # 910|-> switch (attr->nla_type) { # 911| case VDPA_ATTR_DEV_NET_CFG_MAX_VQP: # 912| max_vqp = mnl_attr_get_u16(attr); Error: CLANG_WARNING: iproute2-6.8.0/vdpa/vdpa.c:953:21: warning[deadcode.DeadStores]: Value stored to 'genl' during its initialization is never read # 951| static int cmd_dev_vstats_show_cb(const struct nlmsghdr *nlh, void *data) # 952| { # 953|-> struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); # 954| struct nlattr *tb[VDPA_ATTR_MAX + 1] = {}; # 955| struct vdpa *vdpa = data;