Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/libteam-1.31/examples/team_manual_control.c
Examining data/libteam-1.31/examples/team_monitor.c
Examining data/libteam-1.31/include/linux/filter.h
Examining data/libteam-1.31/include/linux/if_team.h
Examining data/libteam-1.31/include/linux/tipc.h
Examining data/libteam-1.31/include/private/list.h
Examining data/libteam-1.31/include/private/misc.h
Examining data/libteam-1.31/include/team.h
Examining data/libteam-1.31/include/teamdctl.h
Examining data/libteam-1.31/libteam/ifinfo.c
Examining data/libteam-1.31/libteam/libteam.c
Examining data/libteam-1.31/libteam/nl_updates.h
Examining data/libteam-1.31/libteam/options.c
Examining data/libteam-1.31/libteam/ports.c
Examining data/libteam-1.31/libteam/stringify.c
Examining data/libteam-1.31/libteam/team_private.h
Examining data/libteam-1.31/libteamdctl/cli_dbus.c
Examining data/libteam-1.31/libteamdctl/cli_usock.c
Examining data/libteam-1.31/libteamdctl/cli_zmq.c
Examining data/libteam-1.31/libteamdctl/libteamdctl.c
Examining data/libteam-1.31/libteamdctl/teamdctl_private.h
Examining data/libteam-1.31/teamd/teamd.c
Examining data/libteam-1.31/teamd/teamd.h
Examining data/libteam-1.31/teamd/teamd_balancer.c
Examining data/libteam-1.31/teamd/teamd_bpf_chef.c
Examining data/libteam-1.31/teamd/teamd_bpf_chef.h
Examining data/libteam-1.31/teamd/teamd_common.c
Examining data/libteam-1.31/teamd/teamd_config.c
Examining data/libteam-1.31/teamd/teamd_config.h
Examining data/libteam-1.31/teamd/teamd_ctl.c
Examining data/libteam-1.31/teamd/teamd_ctl.h
Examining data/libteam-1.31/teamd/teamd_dbus.c
Examining data/libteam-1.31/teamd/teamd_dbus.h
Examining data/libteam-1.31/teamd/teamd_dbus_common.h
Examining data/libteam-1.31/teamd/teamd_events.c
Examining data/libteam-1.31/teamd/teamd_hash_func.c
Examining data/libteam-1.31/teamd/teamd_ifinfo_watch.c
Examining data/libteam-1.31/teamd/teamd_json.c
Examining data/libteam-1.31/teamd/teamd_json.h
Examining data/libteam-1.31/teamd/teamd_link_watch.c
Examining data/libteam-1.31/teamd/teamd_link_watch.h
Examining data/libteam-1.31/teamd/teamd_lw_arp_ping.c
Examining data/libteam-1.31/teamd/teamd_lw_ethtool.c
Examining data/libteam-1.31/teamd/teamd_lw_nsna_ping.c
Examining data/libteam-1.31/teamd/teamd_lw_psr.c
Examining data/libteam-1.31/teamd/teamd_lw_tipc.c
Examining data/libteam-1.31/teamd/teamd_option_watch.c
Examining data/libteam-1.31/teamd/teamd_per_port.c
Examining data/libteam-1.31/teamd/teamd_phys_port_check.c
Examining data/libteam-1.31/teamd/teamd_phys_port_check.h
Examining data/libteam-1.31/teamd/teamd_runner_activebackup.c
Examining data/libteam-1.31/teamd/teamd_runner_basic_ones.c
Examining data/libteam-1.31/teamd/teamd_runner_lacp.c
Examining data/libteam-1.31/teamd/teamd_runner_loadbalance.c
Examining data/libteam-1.31/teamd/teamd_state.c
Examining data/libteam-1.31/teamd/teamd_state.h
Examining data/libteam-1.31/teamd/teamd_usock.c
Examining data/libteam-1.31/teamd/teamd_usock.h
Examining data/libteam-1.31/teamd/teamd_usock_common.h
Examining data/libteam-1.31/teamd/teamd_workq.c
Examining data/libteam-1.31/teamd/teamd_workq.h
Examining data/libteam-1.31/teamd/teamd_zmq.c
Examining data/libteam-1.31/teamd/teamd_zmq.h
Examining data/libteam-1.31/teamd/teamd_zmq_common.h
Examining data/libteam-1.31/utils/teamdctl.c
Examining data/libteam-1.31/utils/teamnl.c

FINAL RESULTS:

data/libteam-1.31/teamd/teamd.c:1737:6:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
	if (chown(TEAMD_RUN_DIR, pw->pw_uid, pw->pw_gid) < 0) {
data/libteam-1.31/teamd/teamd_phys_port_check.c:46:8:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
	ret = readlink(path, link, sizeof(link) - 1);
data/libteam-1.31/libteam/libteam.c:79:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, format, args);
data/libteam-1.31/libteam/stringify.c:64:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	n = vsnprintf(*pbuf, *pbufsiz, fmt, ap);
data/libteam-1.31/libteam/team_private.h:73:57:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
static inline void __attribute__((always_inline, format(printf, 2, 3)))
data/libteam-1.31/libteamdctl/libteamdctl.c:68:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, format, args);
data/libteam-1.31/libteamdctl/libteamdctl.c:149:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(rcitem->id, id);
data/libteam-1.31/libteamdctl/libteamdctl.c:496:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(id, "%s%s", PC_ID_PREFIX, port_devname);
data/libteam-1.31/libteamdctl/teamdctl_private.h:65:57:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
static inline void __attribute__((always_inline, format(printf, 2, 3)))
data/libteam-1.31/teamd/teamd.c:1581:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
		ret = snprintf(buf, sizeof(buf),
data/libteam-1.31/teamd/teamd_json.c:67:8:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	ret = vsnprintf(path, sizeof(path), fmt, ap);
data/libteam-1.31/teamd/teamd_lw_tipc.c:62:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(tipc_ppriv->bearer, tipc_bearer);
data/libteam-1.31/teamd/teamd_lw_tipc.c:107:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(link->name, lnr->linkname);
data/libteam-1.31/teamd/teamd_lw_tipc.c:121:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(name, lnr->linkname);
data/libteam-1.31/teamd/teamd_runner_lacp.c:56:12:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	uint8_t			system[ETH_ALEN]; /* ID */
data/libteam-1.31/teamd/teamd_runner_lacp.c:312:31:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	if (!memcmp(lacp_port->actor.system,
data/libteam-1.31/teamd/teamd_runner_lacp.c:313:26:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		    lacp_port->partner.system, ETH_ALEN)) {
data/libteam-1.31/teamd/teamd_runner_lacp.c:376:33:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	if (memcmp(lacp_port1->partner.system,
data/libteam-1.31/teamd/teamd_runner_lacp.c:377:26:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		   lacp_port2->partner.system, ETH_ALEN))
data/libteam-1.31/teamd/teamd_runner_lacp.c:411:40:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	system_diff = memcmp(lacp_port->actor.system,
data/libteam-1.31/teamd/teamd_runner_lacp.c:412:28:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
			     lacp_port->partner.system, ETH_ALEN);
data/libteam-1.31/teamd/teamd_runner_lacp.c:906:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	memcpy(actor->system, lacp_port->ctx->hwaddr, ETH_ALEN);
data/libteam-1.31/teamd/teamd_runner_lacp.c:1069:26:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	memcpy(lacp_port->actor.system, lacp_port->ctx->hwaddr, ETH_ALEN);
data/libteam-1.31/teamd/teamd_runner_lacp.c:1564:56:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	char *addr = (char *) lacp_port_actor_gsc(gsc, priv)->system;
data/libteam-1.31/teamd/teamd_runner_lacp.c:1660:58:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	char *addr = (char *) lacp_port_partner_gsc(gsc, priv)->system;
data/libteam-1.31/teamd/teamd_usock_common.h:37:2:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	snprintf(sockpath, sockpath_len, TEAMD_RUN_DIR"%s.sock", team_devname);
data/libteam-1.31/utils/teamdctl.c:64:25:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define pr_err(args...) fprintf(stderr, ##args)
data/libteam-1.31/utils/teamdctl.c:68:3:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		fprintf(stdout, ##args); \
data/libteam-1.31/utils/teamdctl.c:334:8:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	char *system;
data/libteam-1.31/utils/teamdctl.c:342:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
			 "system", &system,
data/libteam-1.31/utils/teamdctl.c:352:26:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	pr_out2("system: %s\n", system);
data/libteam-1.31/libteam/libteam.c:388:8:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	env = getenv("TEAM_LOG");
data/libteam-1.31/libteam/libteam.c:603:8:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	env = getenv("TEAM_EVENT_BUFSIZE");
data/libteam-1.31/libteamdctl/libteamdctl.c:176:8:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	env = getenv("TEAMDCTL_LOG");
data/libteam-1.31/teamd/teamd.c:157:16:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((opt = getopt_long(argc, argv, "hdkevf:c:p:gl:roNt:nDZ:Uu",
data/libteam-1.31/teamd/teamd.c:178:23:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
			ctx->config_file = realpath(optarg, NULL);
data/libteam-1.31/teamd/teamd.c:1516:40:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	ctx->log_output = ctx->log_output ? : getenv("TEAM_LOG_OUTPUT");
data/libteam-1.31/utils/teamdctl.c:990:16:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((opt = getopt_long(argc, argv, "hvoDZ:U",
data/libteam-1.31/utils/teamnl.c:556:16:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((opt = getopt_long(argc, argv, "hp:a:",
data/libteam-1.31/examples/team_manual_control.c:39:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char ifname[32];
data/libteam-1.31/examples/team_monitor.c:30:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char ifname[32];
data/libteam-1.31/include/linux/tipc.h:142:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char usr_handle[8];		/* available for subscriber use */
data/libteam-1.31/include/linux/tipc.h:230:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char linkname[TIPC_MAX_LINK_NAME];
data/libteam-1.31/include/private/misc.h:46:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(dst, src, len);
data/libteam-1.31/include/private/misc.h:59:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(str, "%02x:", (unsigned char) hwaddr[i]);
data/libteam-1.31/libteam/ifinfo.c:54:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char			hwaddr[MAX_ADDR_LEN];
data/libteam-1.31/libteam/ifinfo.c:56:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char			orig_hwaddr[MAX_ADDR_LEN];
data/libteam-1.31/libteam/ifinfo.c:58:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char			ifname[IFNAMSIZ];
data/libteam-1.31/libteam/ifinfo.c:62:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char			phys_port_id[MAX_PHYS_PORT_ID_LEN];
data/libteam-1.31/libteam/ifinfo.c:118:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(ifinfo->hwaddr, hwaddr, hwaddr_len);
data/libteam-1.31/libteam/ifinfo.c:120:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(ifinfo->orig_hwaddr, hwaddr, hwaddr_len);
data/libteam-1.31/libteam/ifinfo.c:183:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(ifinfo->phys_port_id, phys_port_id, phys_port_id_len);
data/libteam-1.31/libteam/libteam.c:1748:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(addr, nl_addr_get_binary_addr(nl_addr), addr_len);
data/libteam-1.31/libteam/options.c:192:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(tmp_data, data, data_size);
data/libteam-1.31/libteam/stringify.c:209:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char byte_str[4];
data/libteam-1.31/libteam/stringify.c:223:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(byte_str, str, 3);
data/libteam-1.31/libteam/stringify.c:374:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char str[hwaddr_str_len(hwaddr_len)];
data/libteam-1.31/libteamdctl/cli_zmq.c:109:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(buf, zmq_msg_data(&msg), ret);
data/libteam-1.31/libteamdctl/libteamdctl.c:489:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char id[sizeof(PC_ID_PREFIX) + IFNAMSIZ + 1];
data/libteam-1.31/libteamdctl/teamdctl_private.h:53:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char id[0];
data/libteam-1.31/teamd/teamd.c:899:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(ctx->hwaddr, hwaddr, hwaddr_len);
data/libteam-1.31/teamd/teamd.c:1121:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/teamd/teamd.c:1135:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/teamd/teamd.c:1152:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/teamd/teamd.c:1574:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[IFNAMSIZ];
data/libteam-1.31/teamd/teamd_json.c:57:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[TEAMD_JSON_PATH_MAXLEN];
data/libteam-1.31/teamd/teamd_json.c:123:40:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			json_obj = json_array_get(json_obj, atoi(ptr));
data/libteam-1.31/teamd/teamd_link_watch.c:62:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(sa, result->ai_addr, sa_len);
data/libteam-1.31/teamd/teamd_lw_arp_ping.c:122:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(addr, &sin.sin_addr, sizeof(*addr));
data/libteam-1.31/teamd/teamd_lw_arp_ping.c:129:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buf[NI_MAXHOST];
data/libteam-1.31/teamd/teamd_lw_arp_ping.c:131:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(&sin.sin_addr, addr, sizeof(*addr));
data/libteam-1.31/teamd/teamd_lw_arp_ping.c:242:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(addr->sll_addr, port_hwaddr, addr->sll_halen);
data/libteam-1.31/teamd/teamd_lw_arp_ping.c:248:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char			sender_mac[ETH_ALEN];
data/libteam-1.31/teamd/teamd_lw_arp_ping.c:250:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char			target_mac[ETH_ALEN];
data/libteam-1.31/teamd/teamd_lw_nsna_ping.c:47:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buf[NI_MAXHOST];
data/libteam-1.31/teamd/teamd_lw_nsna_ping.c:195:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char			hwaddr[ETH_ALEN];
data/libteam-1.31/teamd/teamd_lw_nsna_ping.c:237:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char			hwaddr[ETH_ALEN];
data/libteam-1.31/teamd/teamd_lw_tipc.c:37:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char name[TIPC_MAX_LINK_NAME];
data/libteam-1.31/teamd/teamd_lw_tipc.c:45:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char bearer[TIPC_MAX_BEARER_NAME];
data/libteam-1.31/teamd/teamd_lw_tipc.c:117:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char name[TIPC_MAX_LINK_NAME];
data/libteam-1.31/teamd/teamd_lw_tipc.c:118:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char needle[24];
data/libteam-1.31/teamd/teamd_lw_tipc.c:122:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(needle, "-%u.%u.%u:", tipc_zone(lnr->peer),
data/libteam-1.31/teamd/teamd_phys_port_check.c:37:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char link[256];
data/libteam-1.31/teamd/teamd_runner_activebackup.c:54:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char active_orig_hwaddr[MAX_ADDR_LEN];
data/libteam-1.31/teamd/teamd_runner_activebackup.c:189:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(ab->active_orig_hwaddr,
data/libteam-1.31/teamd/teamd_runner_lacp.c:768:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char slow_addr[ETH_ALEN] = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x02 };
data/libteam-1.31/teamd/teamd_runner_lacp.c:780:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(sa->sa_data, slow_addr, sizeof(slow_addr));
data/libteam-1.31/teamd/teamd_runner_lacp.c:781:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(ifr.ifr_name, devname, strlen(devname));
data/libteam-1.31/teamd/teamd_runner_lacp.c:906:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(actor->system, lacp_port->ctx->hwaddr, ETH_ALEN);
data/libteam-1.31/teamd/teamd_runner_lacp.c:1067:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(ll_slow.sll_addr, slow_addr, ll_slow.sll_halen);
data/libteam-1.31/teamd/teamd_runner_lacp.c:1069:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(lacp_port->actor.system, lacp_port->ctx->hwaddr, ETH_ALEN);
data/libteam-1.31/teamd/teamd_runner_lacp.c:1079:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(lacpdu.hdr.ether_shost, hwaddr, hwaddr_len);
data/libteam-1.31/teamd/teamd_runner_lacp.c:1080:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(lacpdu.hdr.ether_dhost, ll_slow.sll_addr, ll_slow.sll_halen);
data/libteam-1.31/teamd/teamd_workq.c:35:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char bytes[16];
data/libteam-1.31/utils/teamdctl.c:45:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char g_indent_str[INDENT_STR_MAXLEN + 1] = "";
data/libteam-1.31/utils/teamdctl.c:683:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char *params[COMMAND_PARAM_MAX_CNT];
data/libteam-1.31/utils/teamnl.c:51:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char *params[CMD_PARAM_MAX_CNT];
data/libteam-1.31/utils/teamnl.c:59:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/utils/teamnl.c:73:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/utils/teamnl.c:261:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/utils/teamnl.c:287:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/utils/teamnl.c:314:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[120];
data/libteam-1.31/include/private/misc.h:41:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t ret = strlen(src);
data/libteam-1.31/include/private/misc.h:93:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
data/libteam-1.31/libteam/libteam.c:465:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(team_name) >= IFNAMSIZ)
data/libteam-1.31/libteam/options.c:130:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		return sizeof(char) * (strlen((char *) data) + 1);
data/libteam-1.31/libteam/stringify.c:157:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(endptr) != 0)
data/libteam-1.31/libteam/stringify.c:176:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(endptr) != 0)
data/libteam-1.31/libteam/stringify.c:196:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(endptr) != 0)
data/libteam-1.31/libteam/stringify.c:215:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(str) % 3)
data/libteam-1.31/libteam/stringify.c:217:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	numbytes = strlen(str) / 3;
data/libteam-1.31/libteamdctl/cli_usock.c:76:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	err = send(sock, msg, strlen(msg), MSG_NOSIGNAL);
data/libteam-1.31/libteamdctl/cli_usock.c:125:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t len = strlen(str);
data/libteam-1.31/libteamdctl/cli_usock.c:127:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	for (i = 0; i < strlen(str); i++) {
data/libteam-1.31/libteamdctl/cli_usock.c:138:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	for (i = 0; i <= strlen(str); i++) {
data/libteam-1.31/libteamdctl/cli_usock.c:245:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		      strlen(addr.sun_path) + sizeof(addr.sun_family));
data/libteam-1.31/libteamdctl/cli_zmq.c:78:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	int buflen = strlen(buf);
data/libteam-1.31/libteamdctl/libteamdctl.c:144:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	rcitem = myzalloc(sizeof(*rcitem) + strlen(id) + 1);
data/libteam-1.31/libteamdctl/libteamdctl.c:491:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(port_devname) > IFNAMSIZ)
data/libteam-1.31/teamd/teamd.c:261:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, &exp, sizeof(uint64_t));
data/libteam-1.31/teamd/teamd.c:393:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			err = read(ctrl_fd, &ctrl_byte, 1);
data/libteam-1.31/teamd/teamd_dbus.c:378:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	err = read(dp->fd_r, &byte, 1);
data/libteam-1.31/teamd/teamd_json.c:71:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	pathlen = strlen(path);
data/libteam-1.31/teamd/teamd_json.c:110:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				end = ptr + strlen(ptr);
data/libteam-1.31/teamd/teamd_json.c:120:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			for (i = 0; i < strlen(ptr); i++)
data/libteam-1.31/teamd/teamd_lw_tipc.c:60:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(tipc_bearer) >= TIPC_MAX_BEARER_NAME)
data/libteam-1.31/teamd/teamd_runner_lacp.c:781:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	memcpy(ifr.ifr_name, devname, strlen(devname));
data/libteam-1.31/teamd/teamd_state.c:298:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		     strlen(TEAMD_STATE_PER_PORT_PREFIX))) {
data/libteam-1.31/teamd/teamd_state.c:396:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(endptr) != 0)
data/libteam-1.31/teamd/teamd_usock.c:140:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	usock_send(usock_ops_priv, strbuf, strlen(strbuf));
data/libteam-1.31/teamd/teamd_usock.c:155:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	usock_send(usock_ops_priv, strbuf, strlen(strbuf));
data/libteam-1.31/teamd/teamd_usock.c:327:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	           strlen(addr.sun_path) + sizeof(addr.sun_family));
data/libteam-1.31/teamd/teamd_workq.c:40:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(ctx->workq.pipe_r, bytes, sizeof(bytes));
data/libteam-1.31/teamd/teamd_zmq.c:107:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	zmq_custom_send(zmq_ops_priv, strbuf, strlen(strbuf));
data/libteam-1.31/teamd/teamd_zmq.c:122:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	zmq_custom_send(zmq_ops_priv, strbuf, strlen(strbuf));
data/libteam-1.31/utils/teamdctl.c:817:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			     strlen(cmd_name)) &&
data/libteam-1.31/utils/teamnl.c:208:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			len = read(sfd, &fdsi, sizeof(struct signalfd_siginfo));
data/libteam-1.31/utils/teamnl.c:366:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			     strlen(monitor_style_str))) {
data/libteam-1.31/utils/teamnl.c:369:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			     strlen(monitor_style_str))) {
data/libteam-1.31/utils/teamnl.c:458:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(endptr) != 0) {
data/libteam-1.31/utils/teamnl.c:602:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strncmp(cmd_types[i].name, cmd_name, strlen(cmd_name)))

ANALYSIS SUMMARY:

Hits = 141
Lines analyzed = 23300 in approximately 0.50 seconds (46410 lines/second)
Physical Source Lines of Code (SLOC) = 17494
Hits@level = [0] 103 [1]  39 [2]  63 [3]   8 [4]  29 [5]   2
Hits@level+ = [0+] 244 [1+] 141 [2+] 102 [3+]  39 [4+]  31 [5+]   2
Hits/KSLOC@level+ = [0+] 13.9476 [1+] 8.05991 [2+] 5.83057 [3+] 2.22934 [4+] 1.77204 [5+] 0.114325
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.