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/ibsim-0.9/ibsim/ibsim.c
Examining data/ibsim-0.9/ibsim/sim.h
Examining data/ibsim-0.9/ibsim/sim_cmd.c
Examining data/ibsim-0.9/ibsim/sim_mad.c
Examining data/ibsim-0.9/ibsim/sim_net.c
Examining data/ibsim-0.9/include/ibsim.h
Examining data/ibsim-0.9/tests/mcast_storm.c
Examining data/ibsim-0.9/tests/query_many.c
Examining data/ibsim-0.9/tests/subnet_discover.c
Examining data/ibsim-0.9/umad2sim/sim_client.c
Examining data/ibsim-0.9/umad2sim/sim_client.h
Examining data/ibsim-0.9/umad2sim/umad2sim.c

FINAL RESULTS:

data/ibsim-0.9/ibsim/ibsim.c:97:10:  [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.
		size = vsnprintf(name_u->sun_path + 1, size, fmt, args);
data/ibsim-0.9/tests/mcast_storm.c:21:27:  [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 info(fmt, arg...) fprintf(stderr, "INFO: " fmt, ##arg )
data/ibsim-0.9/tests/mcast_storm.c:22:26:  [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 err(fmt, arg...) fprintf(stderr, "ERR: " fmt, ##arg )
data/ibsim-0.9/tests/mcast_storm.c:24:26:  [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 dbg(fmt, arg...) fprintf(stderr, "DBG: " fmt, ##arg )
data/ibsim-0.9/tests/query_many.c:31: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 ERROR(fmt, ...) fprintf(stderr, "ERR: " fmt, ##__VA_ARGS__)
data/ibsim-0.9/tests/query_many.c:32:40:  [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 VERBOSE(fmt, ...) if (verbose) fprintf(stderr, fmt, ##__VA_ARGS__)
data/ibsim-0.9/tests/query_many.c:33:42:  [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 NOISE(fmt, ...) if (verbose > 1) fprintf(stderr, fmt, ##__VA_ARGS__)
data/ibsim-0.9/tests/subnet_discover.c:53: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 ERROR(fmt, ...) fprintf(stderr, "ERR: " fmt, ##__VA_ARGS__)
data/ibsim-0.9/tests/subnet_discover.c:54:40:  [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 VERBOSE(fmt, ...) if (verbose) fprintf(stderr, fmt, ##__VA_ARGS__)
data/ibsim-0.9/tests/subnet_discover.c:55:45:  [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 VERBOSE1(fmt, ...) if (verbose > 1) fprintf(stderr, fmt, ##__VA_ARGS__)
data/ibsim-0.9/tests/subnet_discover.c:56:45:  [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 VERBOSE2(fmt, ...) if (verbose > 2) fprintf(stderr, fmt, ##__VA_ARGS__)
data/ibsim-0.9/umad2sim/sim_client.c:137:10:  [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.
		size = vsnprintf(name_u->sun_path + 1, size, fmt, args);
data/ibsim-0.9/umad2sim/umad2sim.c:59:23:  [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 DEBUG(fmt...) fprintf(stderr, fmt)
data/ibsim-0.9/umad2sim/umad2sim.c:63:23:  [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 ERROR(fmt...) fprintf(stderr, "ERR: " fmt)
data/ibsim-0.9/umad2sim/umad2sim.c:175:8:  [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.
	ret = vfprintf(f, fmt, args);
data/ibsim-0.9/ibsim/ibsim.c:569:18:  [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.
	socket_basename=getenv("IBSIM_SOCKNAME");
data/ibsim-0.9/ibsim/ibsim.c:706:12:  [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.
		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
data/ibsim-0.9/ibsim/sim_mad.c:843:8:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
		    (random() % 100) < destport->errrate) {
data/ibsim-0.9/ibsim/sim_mad.c:1884:7:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	    (random() % 100) < port->errrate) {
data/ibsim-0.9/tests/mcast_storm.c:728:15:  [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 ((ch = getopt_long(argc, argv, opt_str, long_opts, NULL)) != -1) {
data/ibsim-0.9/tests/query_many.c:265:8:  [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.
		ch = getopt_long(argc, argv, "n:d:a:m:C:P:t:r:v", long_opts, NULL);
data/ibsim-0.9/tests/subnet_discover.c:612:8:  [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.
		ch = getopt_long(argc, argv, "C:P:n:t:r:vh", long_opts, NULL);
data/ibsim-0.9/umad2sim/sim_client.c:217:17:  [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.
	connect_port = getenv("IBSIM_SERVER_PORT");
data/ibsim-0.9/umad2sim/sim_client.c:218:17:  [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.
	connect_host = getenv("IBSIM_SERVER_NAME");
data/ibsim-0.9/umad2sim/sim_client.c:219:20:  [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.
	socket_basename = getenv("IBSIM_SOCKNAME");
data/ibsim-0.9/umad2sim/sim_client.c:293:11:  [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.
	nodeid = getenv("SIM_HOST");
data/ibsim-0.9/umad2sim/sim_client.c:294:9:  [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.
	issm = getenv("SIM_SET_ISSM");
data/ibsim-0.9/ibsim/ibsim.c:290: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(gid + 8, &cl->port->node->nodeguid, 8);
data/ibsim-0.9/ibsim/ibsim.c:298: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(guid, &cl->port->node->nodeguid, 8);
data/ibsim-0.9/ibsim/ibsim.c:361: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(ctl->data, port->pkey_tbl, size);
data/ibsim-0.9/ibsim/ibsim.c:465: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[512];
data/ibsim-0.9/ibsim/ibsim.c:547: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 line[128];
data/ibsim-0.9/ibsim/ibsim.c:762:29:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (outfname && (outfile = fopen(outfname, "w")) == NULL)
data/ibsim-0.9/ibsim/sim.h:362: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 remotenodeid[NODEIDLEN];
data/ibsim-0.9/ibsim/sim.h:363: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 remotealias[ALIASLEN + 1];
data/ibsim-0.9/ibsim/sim.h:364: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 alias[ALIASLEN + 1];
data/ibsim-0.9/ibsim/sim.h:401: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 nodeid[NODEIDLEN];	// contain nodeid[NODEIDLEN]
data/ibsim-0.9/ibsim/sim.h:403: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 nodedesc[64];
data/ibsim-0.9/ibsim/sim_cmd.c:448: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[NAMELEN];
data/ibsim-0.9/ibsim/sim_cmd.c:530:8:  [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.
		n += sprintf(comment, "\t# err_rate %d", port->errrate);
data/ibsim-0.9/ibsim/sim_cmd.c:532: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(comment+n, "\t# err_attr %d", port->errattr);
data/ibsim-0.9/ibsim/sim_cmd.c:537: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 comment[100] = "";
data/ibsim-0.9/ibsim/sim_cmd.c:578: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[NAMELEN], *sp;
data/ibsim-0.9/ibsim/sim_cmd.c:893: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[NAMELEN];
data/ibsim-0.9/ibsim/sim_cmd.c:1140: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 line[4096];
data/ibsim-0.9/ibsim/sim_cmd.c:1164:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	cmd_file = fopen(s, "r");
data/ibsim-0.9/ibsim/sim_mad.c:244: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(data, (char *)buf + rpc->dataoffs, rpc->datasz);
data/ibsim-0.9/ibsim/sim_mad.c:287: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((char *)buf + rpc->dataoffs, data, rpc->datasz);
data/ibsim-0.9/ibsim/sim_mad.c:317: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(data, port->node->nodedesc, IB_SMP_DATA_SIZE);
data/ibsim-0.9/ibsim/sim_mad.c:330: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(data, node->nodeinfo, IB_SMP_DATA_SIZE);
data/ibsim-0.9/ibsim/sim_mad.c:356: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(data, sw->switchinfo, IB_SMP_DATA_SIZE);
data/ibsim-0.9/ibsim/sim_mad.c:389: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(pkeys, data, size * sizeof(uint16_t));
data/ibsim-0.9/ibsim/sim_mad.c:392: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(data, pkeys, size * sizeof(uint16_t));
data/ibsim-0.9/ibsim/sim_mad.c:415: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(sl2vl, data, 8);
data/ibsim-0.9/ibsim/sim_mad.c:417: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(data, sl2vl, 8);
data/ibsim-0.9/ibsim/sim_mad.c:453: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(vlarb, data, size);
data/ibsim-0.9/ibsim/sim_mad.c:456: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(data, vlarb, size);
data/ibsim-0.9/ibsim/sim_mad.c:678: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(data, p->portinfo, IB_SMP_DATA_SIZE);
data/ibsim-0.9/ibsim/sim_mad.c:701: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(p->extportinfo, data, IB_SMP_DATA_SIZE);
data/ibsim-0.9/ibsim/sim_mad.c:703: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(data, p->extportinfo, IB_SMP_DATA_SIZE);
data/ibsim-0.9/ibsim/sim_mad.c:1555: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[1024] = "local";
data/ibsim-0.9/ibsim/sim_mad.c:1560: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(buf, "lid %u", lid);
data/ibsim-0.9/ibsim/sim_net.c:71: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 *incfiles[MAX_INCLUDE];
data/ibsim-0.9/ibsim/sim_net.c:195: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 (*aliases)[NODEIDLEN + NODEPREFIX + 1];	// aliases map format: "%s@%s"
data/ibsim-0.9/ibsim/sim_net.c:202: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 netprefix[NODEPREFIX + 1];
data/ibsim-0.9/ibsim/sim_net.c:296: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 nodeid[NODEIDLEN];
data/ibsim-0.9/ibsim/sim_net.c:464: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 speed[10];
data/ibsim-0.9/ibsim/sim_net.c:641: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(port->sl2vl + 8 * j, default_sl2vl, 8);
data/ibsim-0.9/ibsim/sim_net.c:643: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(port->vlarb_high, default_vlarb_high,
data/ibsim-0.9/ibsim/sim_net.c:645: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(port->vlarb_low, default_vlarb_low,
data/ibsim-0.9/ibsim/sim_net.c:715: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 aliasname[ALIASLEN];
data/ibsim-0.9/ibsim/sim_net.c:741: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 remotenodeid[NODEIDLEN], *sp = NULL;
data/ibsim-0.9/ibsim/sim_net.c:751:12:  [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).
	portnum = atoi(line + 1);
data/ibsim-0.9/ibsim/sim_net.c:798:26:  [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).
	if ((port->remoteport = atoi(sp)) <= 0) {
data/ibsim-0.9/ibsim/sim_net.c:824: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 line[MAXLINE], *s;
data/ibsim-0.9/ibsim/sim_net.c:1099: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 line[MAXLINE], *s;
data/ibsim-0.9/ibsim/sim_net.c:1160:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(name, O_RDONLY)) < 0) {
data/ibsim-0.9/include/ibsim.h:71: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 mad[256];
data/ibsim-0.9/include/ibsim.h:95: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 data[SIM_CTL_MAX_DATA];
data/ibsim-0.9/include/ibsim.h:102: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 nodeid[32];
data/ibsim-0.9/tests/mcast_storm.c:527: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(&gid[0], &prefix, 8);
data/ibsim-0.9/tests/mcast_storm.c:528: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(&gid[8], &guid, 8);
data/ibsim-0.9/tests/mcast_storm.c:544: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(&prefix, &gid[0], 8);
data/ibsim-0.9/tests/mcast_storm.c:546: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(&guid, &gid[8], 8);
data/ibsim-0.9/tests/mcast_storm.c:602: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 line[256];
data/ibsim-0.9/tests/mcast_storm.c:609:6:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	f = fopen(guid_file, "r");
data/ibsim-0.9/tests/mcast_storm.c:631: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(list[i].gid, gid, 16);
data/ibsim-0.9/tests/mcast_storm.c:712: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 opt_str[256];
data/ibsim-0.9/tests/query_many.c:37: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[256];
data/ibsim-0.9/tests/subnet_discover.c:61: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[256];
data/ibsim-0.9/tests/subnet_discover.c:70: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 dbg_buf[8192];
data/ibsim-0.9/tests/subnet_discover.c:219: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(q->path, path, path_cnt + 1);
data/ibsim-0.9/tests/subnet_discover.c:313: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(node->path, path, path_size + 1);
data/ibsim-0.9/umad2sim/sim_client.c:82: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(ctl.data, data, len);
data/ibsim-0.9/umad2sim/sim_client.c:101: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(data, &ctl.data, len);
data/ibsim-0.9/umad2sim/sim_client.c:243:24:  [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).
	port = connect_port ? atoi(connect_port) : IBSIM_DEFAULT_SERVER_PORT;
data/ibsim-0.9/umad2sim/sim_client.c:265:24:  [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).
	port = connect_port ? atoi(connect_port) : IBSIM_DEFAULT_SERVER_PORT;
data/ibsim-0.9/umad2sim/umad2sim.c:83: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[32];
data/ibsim-0.9/umad2sim/umad2sim.c:88: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 umad_path[256];
data/ibsim-0.9/umad2sim/umad2sim.c:89: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 issm_path[256];
data/ibsim-0.9/umad2sim/umad2sim.c:114: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 umad2sim_sysfs_prefix[32];
data/ibsim-0.9/umad2sim/umad2sim.c:140: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 dir[1024];
data/ibsim-0.9/umad2sim/umad2sim.c:160: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 file_name[1024];
data/ibsim-0.9/umad2sim/umad2sim.c:169:6:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	f = fopen(file_name, "w");
data/ibsim-0.9/umad2sim/umad2sim.c:184: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[1024];
data/ibsim-0.9/umad2sim/umad2sim.c:374:3:  [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[8];
data/ibsim-0.9/umad2sim/umad2sim.c:455: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(umad_get_mad(umad), req.mad, cnt);
data/ibsim-0.9/umad2sim/umad2sim.c:505: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(req.mad, umad_get_mad(umad), cnt);
data/ibsim-0.9/umad2sim/umad2sim.c:657: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[1024];
data/ibsim-0.9/umad2sim/umad2sim.c:711: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 new_path[1024];
data/ibsim-0.9/umad2sim/umad2sim.c:734: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 new_path[4096];
data/ibsim-0.9/umad2sim/umad2sim.c:753:5:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
int open(const char *path, int flags, ...)
data/ibsim-0.9/umad2sim/umad2sim.c:776:3:  [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 new_path[1024];
data/ibsim-0.9/ibsim/ibsim.c:244:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(scl->nodeid, cl->port->node->nodeid, sizeof(scl->nodeid) - 1);
data/ibsim-0.9/ibsim/ibsim.c:474:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ((size = read(fd, buf, sizeof(buf))) <= 0)
data/ibsim-0.9/ibsim/sim_cmd.c:876:5:  [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(field) < strlen(attr) + 1)
data/ibsim-0.9/ibsim/sim_cmd.c:876:21:  [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(field) < strlen(attr) + 1)
data/ibsim-0.9/ibsim/sim_cmd.c:878: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).
	vl_ptr = field + strlen(attr);
data/ibsim-0.9/ibsim/sim_cmd.c:949:23:  [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).
	field_trim = field + strlen(field) - 1;
data/ibsim-0.9/ibsim/sim_cmd.c:1158:10:  [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).
	p = s + strlen(s) - 1;
data/ibsim-0.9/ibsim/sim_cmd.c:1185: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).
	if (cmd_len != strlen(cmd))
data/ibsim-0.9/ibsim/sim_cmd.c:1187:34:  [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 !(strncasecmp(line, cmd, strlen(cmd)));
data/ibsim-0.9/ibsim/sim_cmd.c:1199:16:  [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).
	max_cmd_len = strlen(line);
data/ibsim-0.9/ibsim/sim_net.c:322:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(nd->nodeid, nodeid, sizeof(nd->nodeid) - 1);
data/ibsim-0.9/ibsim/sim_net.c:323:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(nd->nodedesc, nodedesc && *nodedesc ? nodedesc : nodeid,
data/ibsim-0.9/ibsim/sim_net.c:467:11:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
	if (3 != sscanf(line, "lid %d %dx%9s", &rlid, &width, speed)) {
data/ibsim-0.9/ibsim/sim_net.c:488:41:  [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(speed, LINKSPEED_STR_SDR, strlen(speed))) {
data/ibsim-0.9/ibsim/sim_net.c:490:48:  [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).
	} else if (!strncmp(speed, LINKSPEED_STR_DDR, strlen(speed))) {
data/ibsim-0.9/ibsim/sim_net.c:492:48:  [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).
	} else if (!strncmp(speed, LINKSPEED_STR_QDR, strlen(speed))) {
data/ibsim-0.9/ibsim/sim_net.c:494:48:  [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).
	} else if (!strncmp(speed, LINKSPEED_STR_FDR, strlen(speed))) {
data/ibsim-0.9/ibsim/sim_net.c:498:48:  [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).
	} else if (!strncmp(speed, LINKSPEED_STR_EDR, strlen(speed))) {
data/ibsim-0.9/ibsim/sim_net.c:502:48:  [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).
	} else if (!strncmp(speed, LINKSPEED_STR_HDR, strlen(speed))) {
data/ibsim-0.9/ibsim/sim_net.c:507:50:  [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).
	} else if (!strncmp(speed, LINKSPEED_STR_FDR10, strlen(speed))){
data/ibsim-0.9/ibsim/sim_net.c:654:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(alias, base, ALIASLEN);
data/ibsim-0.9/ibsim/sim_net.c:668: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).
	int len = strlen(alias);
data/ibsim-0.9/ibsim/sim_net.c:690:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(name, base, NODEIDLEN - 1);
data/ibsim-0.9/ibsim/sim_net.c:703:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(name, s, NODEIDLEN - 1);
data/ibsim-0.9/ibsim/sim_net.c:778: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).
		s += strlen(s) + 1;
data/ibsim-0.9/ibsim/sim_net.c:788: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).
	s += strlen(s) + 1;
data/ibsim-0.9/ibsim/sim_net.c:792:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(port->remotenodeid, remotenodeid,
data/ibsim-0.9/ibsim/sim_net.c:1059: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(s) > NODEPREFIX) {
data/ibsim-0.9/ibsim/sim_net.c:1064:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(netprefix, s, NODEPREFIX);
data/ibsim-0.9/ibsim/sim_net.c:1459:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(fd, buf, 1) != 1 || *buf == '\n')
data/ibsim-0.9/tests/mcast_storm.c:581: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).
	} else if (strlen(p) > 18) {
data/ibsim-0.9/tests/mcast_storm.c:582:11:  [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).
		e = p + strlen(p) - 16;
data/ibsim-0.9/tests/mcast_storm.c:656: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).
	int len = strlen(name);
data/ibsim-0.9/umad2sim/sim_client.c:91:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(sc->fd_ctl, &ctl, sizeof(ctl)) != sizeof(ctl)) {
data/ibsim-0.9/umad2sim/sim_client.c:189:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(info.nodeid, nodeid, sizeof(info.nodeid) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:127:4:  [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(sysfs_infiniband_dir)) ||
data/ibsim-0.9/umad2sim/umad2sim.c:129: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(sysfs_infiniband_mad_dir));
data/ibsim-0.9/umad2sim/umad2sim.c:166:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant character.
	strncat(file_name, "/", sizeof(file_name) - strlen(file_name) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:166:46:  [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).
	strncat(file_name, "/", sizeof(file_name) - strlen(file_name) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:167:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(file_name, name, sizeof(file_name) - strlen(file_name) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:167:47:  [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).
	strncat(file_name, name, sizeof(file_name) - strlen(file_name) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:240:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant string.
	strncat(path, "/ports", sizeof(path) - strlen(path) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:240:41:  [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).
	strncat(path, "/ports", sizeof(path) - strlen(path) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:247: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).
	snprintf(path + strlen(path), sizeof(path) - strlen(path), "/%u", val);
data/ibsim-0.9/umad2sim/umad2sim.c:247:47:  [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).
	snprintf(path + strlen(path), sizeof(path) - strlen(path), "/%u", val);
data/ibsim-0.9/umad2sim/umad2sim.c:351: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).
	str = path + strlen(path);
data/ibsim-0.9/umad2sim/umad2sim.c:352:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant string.
	strncat(path, "/gids", sizeof(path) - strlen(path) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:352: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).
	strncat(path, "/gids", sizeof(path) - strlen(path) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:370: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).
	str = path + strlen(path);
data/ibsim-0.9/umad2sim/umad2sim.c:371:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant string.
	strncat(path, "/pkeys", sizeof(path) - strlen(path) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:371:41:  [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).
	strncat(path, "/pkeys", sizeof(path) - strlen(path) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:589:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(dev->name, name, sizeof(dev->name) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:625: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).
	int len = strlen(path);
data/ibsim-0.9/umad2sim/umad2sim.c:665:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(path, umad2sim_sysfs_prefix, sizeof(path) - 1);
data/ibsim-0.9/umad2sim/umad2sim.c:740: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(umad_dev_dir))))
data/ibsim-0.9/umad2sim/umad2sim.c:764: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(umad_dev_dir))))
data/ibsim-0.9/umad2sim/umad2sim.c:813:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
ssize_t read(int fd, void *buf, size_t count)

ANALYSIS SUMMARY:

Hits = 170
Lines analyzed = 9301 in approximately 0.30 seconds (31435 lines/second)
Physical Source Lines of Code (SLOC) = 7466
Hits@level = [0] 160 [1]  57 [2]  86 [3]  12 [4]  15 [5]   0
Hits@level+ = [0+] 330 [1+] 170 [2+] 113 [3+]  27 [4+]  15 [5+]   0
Hits/KSLOC@level+ = [0+] 44.2004 [1+] 22.7699 [2+] 15.1353 [3+] 3.61639 [4+] 2.00911 [5+]   0
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.