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/osmo-ggsn-1.6.0/ggsn/ggsn.c
Examining data/osmo-ggsn-1.6.0/ggsn/ggsn.h
Examining data/osmo-ggsn-1.6.0/ggsn/ggsn_main.c
Examining data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c
Examining data/osmo-ggsn-1.6.0/ggsn/pco.c
Examining data/osmo-ggsn-1.6.0/ggsn/pco.h
Examining data/osmo-ggsn-1.6.0/ggsn/sgsn.c
Examining data/osmo-ggsn-1.6.0/ggsn/sgsn.h
Examining data/osmo-ggsn-1.6.0/gtp/gtp.h
Examining data/osmo-ggsn-1.6.0/gtp/gtpie.c
Examining data/osmo-ggsn-1.6.0/gtp/gtpie.h
Examining data/osmo-ggsn-1.6.0/gtp/lookupa.c
Examining data/osmo-ggsn-1.6.0/gtp/lookupa.h
Examining data/osmo-ggsn-1.6.0/gtp/queue.c
Examining data/osmo-ggsn-1.6.0/gtp/pdp.h
Examining data/osmo-ggsn-1.6.0/gtp/queue.h
Examining data/osmo-ggsn-1.6.0/gtp/pdp.c
Examining data/osmo-ggsn-1.6.0/gtp/gtp.c
Examining data/osmo-ggsn-1.6.0/lib/checksum.c
Examining data/osmo-ggsn-1.6.0/lib/checksum.h
Examining data/osmo-ggsn-1.6.0/lib/debug.c
Examining data/osmo-ggsn-1.6.0/lib/getopt.c
Examining data/osmo-ggsn-1.6.0/lib/getopt1.c
Examining data/osmo-ggsn-1.6.0/lib/gnugetopt.h
Examining data/osmo-ggsn-1.6.0/lib/gtp-kernel.c
Examining data/osmo-ggsn-1.6.0/lib/gtp-kernel.h
Examining data/osmo-ggsn-1.6.0/lib/icmpv6.c
Examining data/osmo-ggsn-1.6.0/lib/icmpv6.h
Examining data/osmo-ggsn-1.6.0/lib/in46_addr.c
Examining data/osmo-ggsn-1.6.0/lib/in46_addr.h
Examining data/osmo-ggsn-1.6.0/lib/ippool.h
Examining data/osmo-ggsn-1.6.0/lib/lookup.c
Examining data/osmo-ggsn-1.6.0/lib/lookup.h
Examining data/osmo-ggsn-1.6.0/lib/netdev.c
Examining data/osmo-ggsn-1.6.0/lib/netdev.h
Examining data/osmo-ggsn-1.6.0/lib/netns.c
Examining data/osmo-ggsn-1.6.0/lib/netns.h
Examining data/osmo-ggsn-1.6.0/lib/syserr.h
Examining data/osmo-ggsn-1.6.0/lib/tun.c
Examining data/osmo-ggsn-1.6.0/lib/tun.h
Examining data/osmo-ggsn-1.6.0/lib/util.c
Examining data/osmo-ggsn-1.6.0/lib/util.h
Examining data/osmo-ggsn-1.6.0/lib/ippool.c
Examining data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c
Examining data/osmo-ggsn-1.6.0/sgsnemu/cmdline.h
Examining data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c
Examining data/osmo-ggsn-1.6.0/tests/gtp/gtpie_test.c
Examining data/osmo-ggsn-1.6.0/tests/gtp/queue_test.c
Examining data/osmo-ggsn-1.6.0/tests/lib/ippool_test.c
Examining data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c

FINAL RESULTS:

data/osmo-ggsn-1.6.0/lib/ippool.c:125: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(pool, pool_in);
data/osmo-ggsn-1.6.0/lib/tun.c:192:4:  [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(ifr.ifr_name, dev_name);
data/osmo-ggsn-1.6.0/lib/tun.c:341:7:  [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.
	rc = system(buf);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:609: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(result, s);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1797:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
		strcat(my_argv, len > 1 ? "--" : "-");
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1798:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
		strcat(my_argv, fopt);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1802:4:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
			strcat(my_argv, farg);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1866:3:  [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(additional_error, ADDITIONAL_ERROR);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1867:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
		strcat(additional_error, filename);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1038: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.
        snprintf(path, sizeof(path), fmt, dev, file);
data/osmo-ggsn-1.6.0/ggsn/ggsn_main.c:112:7:  [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.
		c = getopt_long(argc, argv, "hdc:V", long_options, &option_index);
data/osmo-ggsn-1.6.0/lib/getopt.c:209: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.
#ifndef getenv
data/osmo-ggsn-1.6.0/lib/getopt.c:210:14:  [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.
extern char *getenv();
data/osmo-ggsn-1.6.0/lib/getopt.c:385: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.
	posixly_correct = getenv("POSIXLY_CORRECT");
data/osmo-ggsn-1.6.0/lib/getopt.c:932:5:  [3] (buffer) getopt:
  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 getopt(argc, argv, optstring)
data/osmo-ggsn-1.6.0/lib/getopt.c:958:7:  [3] (buffer) getopt:
  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.
		c = getopt(argc, argv, "abc:d:0123456789");
data/osmo-ggsn-1.6.0/lib/getopt1.c:65:5:  [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 getopt_long(argc, argv, options, long_options, opt_index)
data/osmo-ggsn-1.6.0/lib/getopt1.c:118:7:  [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.
		c = getopt_long(argc, argv, "abc:d:0123456789",
data/osmo-ggsn-1.6.0/lib/gnugetopt.h:143:13:  [3] (buffer) getopt:
  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.
	extern int getopt(int __argc, char *const *__argv,
data/osmo-ggsn-1.6.0/lib/gnugetopt.h:146:13:  [3] (buffer) getopt:
  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.
	extern int getopt();
data/osmo-ggsn-1.6.0/lib/gnugetopt.h:150:13:  [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.
	extern int getopt_long(int __argc, char *const *__argv,
data/osmo-ggsn-1.6.0/lib/gnugetopt.h:165:13:  [3] (buffer) getopt:
  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.
	extern int getopt();
data/osmo-ggsn-1.6.0/lib/gnugetopt.h:167:13:  [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.
	extern int getopt_long();
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:975:7:  [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.
		c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:t:",
data/osmo-ggsn-1.6.0/tests/gtp/gtpie_test.c:118:2:  [3] (random) srand:
  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.
	srand(time(NULL));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:442:2:  [3] (random) srand:
  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.
	srand(time(NULL));
data/osmo-ggsn-1.6.0/tests/lib/ippool_test.c:136:2:  [3] (random) srand:
  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.
	srand(time(NULL));
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:332: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 addrbuf[256];
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:333: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 val[NAMESIZE];
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:433: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 name_buf[256];
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:438: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 straddrv4[INET_ADDRSTRLEN], straddrv6[INET6_ADDRSTRLEN];
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:474: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(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0));
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:476: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(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l);	/* TODO */
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:504: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(&addr[i].v4.s_addr, &member->addr.v4, 4);
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:521: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(addr[i].v6.s6_addr, &member->addr.v6, 8);
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:523: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(addr[i].v6.s6_addr+8, &member->addr.v6, 8);
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:592: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 straddr[INET6_ADDRSTRLEN];
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:612: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.v6, ((uint8_t*)&ip6h->ip6_dst) + pref_offset, 8);
data/osmo-ggsn-1.6.0/ggsn/ggsn.c:646: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 straddr[INET6_ADDRSTRLEN];
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:335: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[INET_ADDRSTRLEN];
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:369:28:  [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).
	ggsn->cfg.echo_interval = atoi(argv[0]);
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:621: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).
	int idx = atoi(argv[0]);
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:634: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).
	int idx = atoi(argv[0]);
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:648: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).
	int idx = atoi(argv[1]);
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:810: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(&in46.v6, in->v, in->l);
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:821: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_buf[256];
data/osmo-ggsn-1.6.0/ggsn/ggsn_vty.c:900:11:  [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).
		nsapi = atoi(argv[2]);
data/osmo-ggsn-1.6.0/ggsn/pco.c:92: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(pap_out->data+1, pap_welcome, pap_welcome_len);
data/osmo-ggsn-1.6.0/ggsn/pco.c:247: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(pdp->pco_neg.v, msgb_data(resp), msgb_length(resp));
data/osmo-ggsn-1.6.0/ggsn/sgsn.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 buf[INET_ADDRSTRLEN];
data/osmo-ggsn-1.6.0/ggsn/sgsn.h:44: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[INET_ADDRSTRLEN]; \
data/osmo-ggsn-1.6.0/gtp/gtp.c:629: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(&qmsg->p, packet, sizeof(union gtp_packet));
data/osmo-ggsn-1.6.0/gtp/gtp.c:756: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(&qmsg->p, packet, sizeof(union gtp_packet));
data/osmo-ggsn-1.6.0/gtp/gtp.c:856:12:  [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 (!(f = fopen(filename, "r"))) {
data/osmo-ggsn-1.6.0/gtp/gtp.c:879: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(filename, "w");
data/osmo-ggsn-1.6.0/gtp/gtp.c:1725: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(&pdp_old->gsnrc.v, &pdp->gsnrc.v, pdp->gsnrc.l);
data/osmo-ggsn-1.6.0/gtp/gtp.c:1727: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(&pdp_old->gsnru.v, &pdp->gsnru.v, pdp->gsnru.l);
data/osmo-ggsn-1.6.0/gtp/gtp.c:2197: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2214: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2224: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2237: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2254: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2282: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2293: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2305: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(pdp, &pdp_backup, sizeof(pdp_backup));
data/osmo-ggsn-1.6.0/gtp/gtp.c:2877: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 buffer[PACKET_MAX];
data/osmo-ggsn-1.6.0/gtp/gtp.c:3024: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 buffer[PACKET_MAX];
data/osmo-ggsn-1.6.0/gtp/gtp.c:3201: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 buffer[PACKET_MAX];
data/osmo-ggsn-1.6.0/gtp/gtp.c:3345: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_addr, pdp->gsnru.v, pdp->gsnru.l);	/* TODO range check */
data/osmo-ggsn-1.6.0/gtp/gtp.c:3436: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(&eua->v[2], src, 4);
data/osmo-ggsn-1.6.0/gtp/gtp.c:3447: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(dst, &eua->v[2], 4);
data/osmo-ggsn-1.6.0/gtp/gtp.c:3456: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(dst, gsna->v, gsna->l);
data/osmo-ggsn-1.6.0/gtp/gtp.c:3464: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(gsna->v, src, gsna->l);
data/osmo-ggsn-1.6.0/gtp/gtp.c:3474: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[sizeof(*imsi)*2+1];
data/osmo-ggsn-1.6.0/gtp/gtpie.c:57: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((void *)(p + *length + 3), v, l);
data/osmo-ggsn-1.6.0/gtp/gtpie.c:76: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((void *)(p + *length + 1), v, l);
data/osmo-ggsn-1.6.0/gtp/gtpie.c:203: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(dst, ie[ien]->tlv.v, *length);
data/osmo-ggsn-1.6.0/gtp/gtpie.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(dst, ie[ien]->tv0.v, size);
data/osmo-ggsn-1.6.0/gtp/gtpie.c:762:5:  [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, ie[i], iesize);
data/osmo-ggsn-1.6.0/gtp/gtpie.c:939:6:  [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, &ie[i], iesize);
data/osmo-ggsn-1.6.0/gtp/pdp.c:137:5:  [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(*pdp, pdp_old, sizeof(struct pdp_t));
data/osmo-ggsn-1.6.0/gtp/pdp.h:51: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 v[16];
data/osmo-ggsn-1.6.0/gtp/pdp.h:56: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 v[66];
data/osmo-ggsn-1.6.0/gtp/pdp.h:61: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 v[255];
data/osmo-ggsn-1.6.0/gtp/queue.c:86: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(&qmsg->peer, peer, sizeof(*peer));
data/osmo-ggsn-1.6.0/lib/gtp-kernel.c:42: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 buf4[INET_ADDRSTRLEN], buf6[INET6_ADDRSTRLEN];
data/osmo-ggsn-1.6.0/lib/gtp-kernel.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(&ms, &pdp->eua.v[2], sizeof(struct in_addr));
data/osmo-ggsn-1.6.0/lib/gtp-kernel.c:123: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(&sgsn, &pdp->gsnrc.v[0], sizeof(struct in_addr));
data/osmo-ggsn-1.6.0/lib/in46_addr.c:87: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 addrstr_buf[256];
data/osmo-ggsn-1.6.0/lib/in46_addr.c:96: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 addrstr_buf[256];
data/osmo-ggsn-1.6.0/lib/in46_addr.c:276: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(&eua->v[2], &src->v4, 4);	/* Copy a 4 byte address */
data/osmo-ggsn-1.6.0/lib/in46_addr.c:283: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(&eua->v[2], &src->v6, 16);	/* Copy a 16 byte address */
data/osmo-ggsn-1.6.0/lib/in46_addr.c:301: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(&eua->v[2], &src_v4->v4, 4);
data/osmo-ggsn-1.6.0/lib/in46_addr.c:302: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(&eua->v[6], &src_v6->v6, 16);
data/osmo-ggsn-1.6.0/lib/in46_addr.c:332: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(&dst->v4, &eua->v[2], 4);	/* Copy a 4 byte address */
data/osmo-ggsn-1.6.0/lib/in46_addr.c:339: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(&dst->v6, &eua->v[2], 16);	/* Copy a 16 byte address */
data/osmo-ggsn-1.6.0/lib/in46_addr.c:351:5:  [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[0].v4, &eua->v[2], 4);
data/osmo-ggsn-1.6.0/lib/in46_addr.c:356:5:  [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[1].v6, &eua->v[2], 16);
data/osmo-ggsn-1.6.0/lib/in46_addr.c:359:5:  [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[0].v4, &eua->v[2], 4);
data/osmo-ggsn-1.6.0/lib/in46_addr.c:360:5:  [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[1].v6, &eua->v[6], 16);
data/osmo-ggsn-1.6.0/lib/ippool.c:36: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 s[256];
data/osmo-ggsn-1.6.0/lib/ippool.c:123: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 pool[strlen(pool_in)+1];
data/osmo-ggsn-1.6.0/lib/netdev.c:71: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(RTA_DATA(rta), d, dlen);
data/osmo-ggsn-1.6.0/lib/netdev.c:129: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(&((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr, addr,
data/osmo-ggsn-1.6.0/lib/netdev.c:145: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(&((struct sockaddr_in *)&ifr.ifr_dstaddr)->sin_addr,
data/osmo-ggsn-1.6.0/lib/netdev.c:157: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(&((struct sockaddr_in *)&ifr.ifr_netmask)->sin_addr,
data/osmo-ggsn-1.6.0/lib/netdev.c:212: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(&ifr.ifr6_addr, addr, sizeof(*addr));
data/osmo-ggsn-1.6.0/lib/netdev.c:227: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(&ifr.ifr6_addr, dstaddr, sizeof(*dstaddr));
data/osmo-ggsn-1.6.0/lib/netdev.c:271: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 buf[TUN_NLBUFSIZE];
data/osmo-ggsn-1.6.0/lib/netdev.c:420: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 buf[TUN_NLBUFSIZE];
data/osmo-ggsn-1.6.0/lib/netdev.c:574: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(&((struct sockaddr_in *)&r.rt_dst)->sin_addr, dst, sizeof(*dst));
data/osmo-ggsn-1.6.0/lib/netdev.c:575: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(&((struct sockaddr_in *)&r.rt_gateway)->sin_addr, gateway,
data/osmo-ggsn-1.6.0/lib/netdev.c:577: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(&((struct sockaddr_in *)&r.rt_genmask)->sin_addr, mask,
data/osmo-ggsn-1.6.0/lib/netdev.c:675: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(&r.rtmsg_dst, dst->s6_addr, sizeof(struct in6_addr));
data/osmo-ggsn-1.6.0/lib/netdev.c:676: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(&r.rtmsg_gateway, gateway->s6_addr, sizeof(struct in6_addr));
data/osmo-ggsn-1.6.0/lib/netns.c:115: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(pathname, flags)) < 0) {
data/osmo-ggsn-1.6.0/lib/netns.c:200:22:  [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 ((default_nsfd = open("/proc/self/ns/net", O_RDONLY)) < 0)
data/osmo-ggsn-1.6.0/lib/netns.c:215: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[MAXPATHLEN] = NETNS_PATH;
data/osmo-ggsn-1.6.0/lib/netns.c:226:7:  [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).
	fd = open(path, O_RDONLY|O_CREAT|O_EXCL, 0);
data/osmo-ggsn-1.6.0/lib/netns.c:229:14:  [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(path, O_RDONLY)) < 0)
data/osmo-ggsn-1.6.0/lib/netns.c:266: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(path, O_RDONLY)) < 0)
data/osmo-ggsn-1.6.0/lib/tun.c:98: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(&this->dstaddr.v6, dstaddr, sizeof(*dstaddr));
data/osmo-ggsn-1.6.0/lib/tun.c:165: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 devname[IFNAMSIZ + 5];	/* "/dev/" + ifname */
data/osmo-ggsn-1.6.0/lib/tun.c:183:21:  [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 (((*tun)->fd = open("/dev/net/tun", O_RDWR)) < 0) {
data/osmo-ggsn-1.6.0/lib/tun.c:231:21:  [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 (((*tun)->fd = open(devname, O_RDWR)) >= 0)
data/osmo-ggsn-1.6.0/lib/tun.c:305: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 buffer[PACKET_MAX];
data/osmo-ggsn-1.6.0/lib/tun.c:327: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[TUN_SCRIPTSIZE];
data/osmo-ggsn-1.6.0/lib/tun.c:328: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 snet[TUN_ADDRSIZE];
data/osmo-ggsn-1.6.0/lib/tun.c:329: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 smask[TUN_ADDRSIZE];
data/osmo-ggsn-1.6.0/lib/tun.h:39: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 devname[IFNAMSIZ];	/* Name of the tun device */
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:580:12:  [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).
	outfile = fopen(filename, "w");
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1687: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 my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1];
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1688: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 linebuf[CONFIG_FILE_LINE_SIZE];
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1696:14:  [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 ((file = fopen(filename, "r")) == 0) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:255:9:  [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).
	file = fopen(pidfile, "w");
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:440: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(&options.dns.s_addr, host->h_addr,
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:462: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(&options.listen.s_addr, host->h_addr,
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:483: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(&options.remote.s_addr, host->h_addr,
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:689:11:  [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).
		lac_d = atoi(lac);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:701:11:  [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).
		lac_d = atoi(rest);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:767:11:  [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).
		lac_d = atoi(lac);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:779:11:  [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).
		lac_d = atoi(rest);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:803:10:  [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).
		sign = atoi(mstz_el[0]);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:810:16:  [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).
		nbquarters = atoi(mstz_el[1]);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:817:9:  [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).
		DST = atoi(mstz_el[2]);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:897: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(&options.pco.v[9], args_info.uid_arg, strlen(args_info.uid_arg));
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:900: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(&options.pco.v[10 + strlen(args_info.uid_arg)],
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1017: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).
        f = fopen(path, "w");
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1037: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.
        char path[strlen(fmt) + strlen(dev) + strlen(file)+1];
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1279: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 straddr[128];
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1317: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(&tp, ic6h->data, sizeof(struct timeval));
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1410: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(&v16, p8, 2);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1425: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(&v16, p8, 2);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1648: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(addr[i].v6.s6_addr, ll_prefix, sizeof(ll_prefix));
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1765: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 ip6strbuf[200];
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1780:5:  [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.v6.s6_addr, opt_prefix->prefix, prefix_len_bytes);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1860: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[10];
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2012:5:  [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(pdp->qos_req0, options.qos.v,
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2018: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(pdp->qos_req.v, options.qos.v, options.qos.l);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2023: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(pdp->rattype.v, options.rattype.v, options.rattype.l);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2027: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(pdp->userloc.v, options.userloc.v, options.userloc.l);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2031: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(pdp->rai.v, options.rai.v, options.rai.l);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2035: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(pdp->mstz.v, options.mstz.v, options.mstz.l);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2039: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(pdp->imeisv.v, options.imeisv.v, options.imeisv.l);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2050: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(pdp->apn_use.v, options.apn.v, options.apn.l);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2054: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(pdp->gsnlc.v, &options.listen, sizeof(options.listen));
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2056: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(pdp->gsnlu.v, &options.listen, sizeof(options.listen));
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:2077: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(pdp->pco_req.v, options.pco.v, options.pco.l);
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c: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 buf[256];
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:181: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(eua.v, v4_unspec, sizeof(v4_unspec));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:188: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(eua.v, v4_spec, sizeof(v4_spec));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:258: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[256];
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:338: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(eua.v, v6_unspec, sizeof(v6_unspec));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:345: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(eua.v, v6_spec, sizeof(v6_spec));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:365: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(eua.v, v4_unspec_v6_unspec, sizeof(v4_unspec_v6_unspec));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:374: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(eua.v, v4_spec_v6_unspec, sizeof(v4_spec_v6_unspec));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:383: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(eua.v, v4_unspec_v6_spec, sizeof(v4_unspec_v6_spec));
data/osmo-ggsn-1.6.0/tests/lib/in46a_test.c:392: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(eua.v, v4_spec_v6_spec, sizeof(v4_spec_v6_spec));
data/osmo-ggsn-1.6.0/ggsn/pco.c:84: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).
		pap_welcome_len = strlen(pap_welcome);
data/osmo-ggsn-1.6.0/gtp/gtp.c:878:6:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	i = umask(022);
data/osmo-ggsn-1.6.0/gtp/gtp.c:880:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(i);
data/osmo-ggsn-1.6.0/lib/getopt.c:230: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).
#if (!defined __STDC__ || !__STDC__) && !defined strlen
data/osmo-ggsn-1.6.0/lib/getopt.c:233: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).
extern int strlen(const char *);
data/osmo-ggsn-1.6.0/lib/getopt.c:410: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(orig_str);
data/osmo-ggsn-1.6.0/lib/getopt.c:635: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).
				    == (unsigned int)strlen(p->name)) {
data/osmo-ggsn-1.6.0/lib/getopt.c:658: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).
			nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/getopt.c:692: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).
					nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/getopt.c:707: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).
					nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/getopt.c:712: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).
			nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/getopt.c:825: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).
					    strlen(p->name)) {
data/osmo-ggsn-1.6.0/lib/getopt.c:845: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).
				nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/getopt.c:861: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).
						nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/getopt.c:875: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).
						nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/getopt.c:880: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).
				nextchar += strlen(nextchar);
data/osmo-ggsn-1.6.0/lib/in46_addr.c:73:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
		strncpy(dst, "UNDEFINED", dst_size);
data/osmo-ggsn-1.6.0/lib/ippool.c:123: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).
	char pool[strlen(pool_in)+1];
data/osmo-ggsn-1.6.0/lib/netdev.c:84: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, devname, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/netdev.c:119: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, devname, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/netdev.c:201: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, devname, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/netdev.c:374:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(areq.ifra_name, devname, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/netdev.c:523:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(areq.ifra_name, devname, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/netdev.c:664:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ifr.ifr_name, gw_iface, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/tun.c:199:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy((*tun)->devname, ifr.ifr_name, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/tun.c:208:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy((*tun)->devname, dev_name, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/tun.c:251:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(areq.ifra_name, (*tun)->devname, IFNAMSIZ);
data/osmo-ggsn-1.6.0/lib/tun.c:308:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ((status = read(this->fd, buffer, sizeof(buffer))) <= 0) {
data/osmo-ggsn-1.6.0/lib/tun.c:332:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(snet, inet_ntoa(tun->addr.v4), sizeof(snet));
data/osmo-ggsn-1.6.0/lib/tun.c:334:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(smask, inet_ntoa(tun->netmask), sizeof(smask));
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:321: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).
	       (strlen(CMDLINE_PARSER_PACKAGE_NAME) ?
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:325: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(gengetopt_args_info_versiontext) > 0)
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:333: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(gengetopt_args_info_purpose) > 0)
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:336: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(gengetopt_args_info_usage) > 0)
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:341: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(gengetopt_args_info_description) > 0)
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:606: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).
	result = (char *)malloc(strlen(s) + 1);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1690:18:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
	int result = 0, equal;
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1705: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).
		len = strlen(linebuf);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1740:8:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
		if (!equal)
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1796: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).
		len = strlen(fopt);
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1799:38:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
		if (len > 1 && ((farg && *farg) || equal))
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1800:4:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
			strcat(my_argv, "=");
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1864:22:  [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).
		    (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) +
data/osmo-ggsn-1.6.0/sgsnemu/cmdline.c:1864: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).
		    (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) +
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:254:12:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	oldmask = umask(022);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:256:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(oldmask);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:495: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(args_info.imsi_arg) != 15) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:587: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(args_info.apn_arg) > (sizeof(options.apn.v) - 1)) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:591: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).
	options.apn.l = strlen(args_info.apn_arg) + 1;
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:597: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).
		     size_t len = strlen(tok);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:600:8:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		     strncpy(apn, tok, len);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:637: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).
		if ((strlen(type) != 1) || (!isdigit(type[0]))) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:647: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(mcc) != 3) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:666: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).
		if ((strlen(mnc) > 3) || (strlen(mnc) < 2)) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:666:29:  [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(mnc) > 3) || (strlen(mnc) < 2)) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:670: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(mnc) == 2) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:673: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(mnc) == 3) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:731: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(mcc) != 3) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:747: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).
		if ((strlen(mnc) > 3) || (strlen(mnc) < 2)) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:747:29:  [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(mnc) > 3) || (strlen(mnc) < 2)) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:751: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(mnc) == 2) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:754: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(mnc) == 3) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:844: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(args_info.imeisv_arg) != 16) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:858: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(args_info.msisdn_arg) > (sizeof(options.msisdn.v) - 1)) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:864: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 (n = 0; n < strlen(args_info.msisdn_arg); n++) {
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:879: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(args_info.uid_arg) + strlen(args_info.pwd_arg) + 10) >
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:879:35:  [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(args_info.uid_arg) + strlen(args_info.pwd_arg) + 10) >
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:885: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).
	    strlen(args_info.uid_arg) + strlen(args_info.pwd_arg) + 10;
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:885: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).
	    strlen(args_info.uid_arg) + strlen(args_info.pwd_arg) + 10;
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:890: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).
	    strlen(args_info.uid_arg) + strlen(args_info.pwd_arg) + 6;
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:890: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).
	    strlen(args_info.uid_arg) + strlen(args_info.pwd_arg) + 6;
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:895: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).
	    strlen(args_info.uid_arg) + strlen(args_info.pwd_arg) + 6;
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:895: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).
	    strlen(args_info.uid_arg) + strlen(args_info.pwd_arg) + 6;
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:896: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).
	options.pco.v[8] = strlen(args_info.uid_arg);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:897: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).
	memcpy(&options.pco.v[9], args_info.uid_arg, strlen(args_info.uid_arg));
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:898: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).
	options.pco.v[9 + strlen(args_info.uid_arg)] =
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:899: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).
	    strlen(args_info.pwd_arg);
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:900:29:  [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(&options.pco.v[10 + strlen(args_info.uid_arg)],
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:901:28:  [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).
	       args_info.pwd_arg, strlen(args_info.pwd_arg));
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1037: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).
        char path[strlen(fmt) + strlen(dev) + strlen(file)+1];
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1037:33:  [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).
        char path[strlen(fmt) + strlen(dev) + strlen(file)+1];
data/osmo-ggsn-1.6.0/sgsnemu/sgsnemu.c:1037: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).
        char path[strlen(fmt) + strlen(dev) + strlen(file)+1];

ANALYSIS SUMMARY:

Hits = 260
Lines analyzed = 20282 in approximately 0.63 seconds (32389 lines/second)
Physical Source Lines of Code (SLOC) = 14667
Hits@level = [0] 331 [1]  82 [2] 151 [3]  17 [4]  10 [5]   0
Hits@level+ = [0+] 591 [1+] 260 [2+] 178 [3+]  27 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 40.2945 [1+] 17.7269 [2+] 12.1361 [3+] 1.84087 [4+] 0.681803 [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.