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/n2n-1.3.1~svn3789/twofish.h
Examining data/n2n-1.3.1~svn3789/twofish.c
Examining data/n2n-1.3.1~svn3789/supernode.c
Examining data/n2n-1.3.1~svn3789/tuntap_freebsd.c
Examining data/n2n-1.3.1~svn3789/minilzo.h
Examining data/n2n-1.3.1~svn3789/tuntap_osx.c
Examining data/n2n-1.3.1~svn3789/lzoconf.h
Examining data/n2n-1.3.1~svn3789/lzodefs.h
Examining data/n2n-1.3.1~svn3789/tuntap_linux.c
Examining data/n2n-1.3.1~svn3789/edge.c
Examining data/n2n-1.3.1~svn3789/n2n.h
Examining data/n2n-1.3.1~svn3789/minilzo.c
Examining data/n2n-1.3.1~svn3789/n2n.c

FINAL RESULTS:

data/n2n-1.3.1~svn3789/n2n.c:319:5:  [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.
    vsnprintf(buf, sizeof(buf)-1, format, va_ap);
data/n2n-1.3.1~svn3789/tuntap_freebsd.c:62:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        system(buf);
data/n2n-1.3.1~svn3789/tuntap_freebsd.c:67:5:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    system(buf);
data/n2n-1.3.1~svn3789/tuntap_freebsd.c:77:10:  [4] (shell) popen:
  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.
    fd = popen(buf, "r");
data/n2n-1.3.1~svn3789/tuntap_linux.c:31: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(ifr.ifr_name, ifname);
data/n2n-1.3.1~svn3789/tuntap_linux.c:95: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.
      system(buf);
data/n2n-1.3.1~svn3789/tuntap_linux.c:101:3:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  system(buf);
data/n2n-1.3.1~svn3789/tuntap_osx.c:62:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        system(buf);
data/n2n-1.3.1~svn3789/tuntap_osx.c:67:5:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    system(buf);
data/n2n-1.3.1~svn3789/tuntap_osx.c:77:10:  [4] (shell) popen:
  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.
    fd = popen(buf, "r");
data/n2n-1.3.1~svn3789/edge.c:1181:7:  [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.
  if( getenv( "N2N_KEY" )) {
data/n2n-1.3.1~svn3789/edge.c:1182:27:  [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.
    encrypt_key = strdup( getenv( "N2N_KEY" ));
data/n2n-1.3.1~svn3789/edge.c:1233:16:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while((opt = getopt_long(effectiveargc, effectiveargv, "k:a:bc:u:g:m:M:s:d:l:p:fvhrt", long_options, NULL)) != EOF) {
data/n2n-1.3.1~svn3789/supernode.c:451:16:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while((opt = getopt_long(argc, argv, "l:vh", long_options, NULL)) != EOF) {
data/n2n-1.3.1~svn3789/twofish.c:180:11:  [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((unsigned int)time(NULL)); 
data/n2n-1.3.1~svn3789/edge.c:42: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                supernode_ip[48];
data/n2n-1.3.1~svn3789/edge.c:91:8:  [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).
  fd = fopen(filename, "rb");
data/n2n-1.3.1~svn3789/edge.c:304: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 pkt[N2N_PKT_HDR_SIZE];
data/n2n-1.3.1~svn3789/edge.c:311: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(hdr.community_name, eee->community_name, COMMUNITY_LEN);
data/n2n-1.3.1~svn3789/edge.c:327: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 pkt[N2N_PKT_HDR_SIZE];
data/n2n-1.3.1~svn3789/edge.c:333: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(hdr.community_name, eee->community_name, COMMUNITY_LEN);
data/n2n-1.3.1~svn3789/edge.c:379:7:  [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(scan->mac_addr, hdr->src_mac, 6);
data/n2n-1.3.1~svn3789/edge.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(buffer, gratuitous_arp, sizeof(gratuitous_arp));
data/n2n-1.3.1~svn3789/edge.c:630: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(&buffer[6], device.mac_addr, 6);
data/n2n-1.3.1~svn3789/edge.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(&buffer[22], device.mac_addr, 6);
data/n2n-1.3.1~svn3789/edge.c:632: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(&buffer[28], &device.ip_addr, 4);
data/n2n-1.3.1~svn3789/edge.c:637: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(&buffer[38], &device.ip_addr, 4);
data/n2n-1.3.1~svn3789/edge.c:644: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 buffer[48];
data/n2n-1.3.1~svn3789/edge.c:706:9:  [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(destination, &scan->public_ip, sizeof(struct sockaddr_in));
data/n2n-1.3.1~svn3789/edge.c:715:7:  [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(destination, &(eee->supernode), sizeof(struct sockaddr_in));
data/n2n-1.3.1~svn3789/edge.c:746: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 packet[2048];
data/n2n-1.3.1~svn3789/edge.c:783: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(hdr.community_name, eee->community_name, COMMUNITY_LEN);
data/n2n-1.3.1~svn3789/edge.c:784: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(hdr.dst_mac, decrypted_msg, 6);
data/n2n-1.3.1~svn3789/edge.c:936: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 packet[2048], decrypted_msg[2048];
data/n2n-1.3.1~svn3789/edge.c:1105:35:  [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).
      eee->supernode.port = htons(atoi(supernode_port));
data/n2n-1.3.1~svn3789/edge.c:1154: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  netmask[N2N_NETMASK_STR_SIZE]="255.255.255.0";
data/n2n-1.3.1~svn3789/edge.c:1248:18:  [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).
        userid = atoi(optarg);
data/n2n-1.3.1~svn3789/edge.c:1253:19:  [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).
        groupid = atoi(optarg);
data/n2n-1.3.1~svn3789/edge.c:1269:15:  [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).
        mtu = atoi(optarg);
data/n2n-1.3.1~svn3789/edge.c:1294:20:  [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).
      local_port = atoi(optarg);
data/n2n-1.3.1~svn3789/minilzo.c:1972:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#  undef memcpy
data/n2n-1.3.1~svn3789/minilzo.c:1973:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#  define memcpy(a,b,c)         lzo_memcpy(a,b,c)
data/n2n-1.3.1~svn3789/minilzo.c:1975:33:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#  define lzo_memcpy(a,b,c)     memcpy(a,b,c)
data/n2n-1.3.1~svn3789/minilzo.c:2373:12:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    return memcpy(dest, src, len);
data/n2n-1.3.1~svn3789/minilzo.c:2447:22:  [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.
    union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u;
data/n2n-1.3.1~svn3789/n2n.c:39:1:  [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 broadcast_addr[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
data/n2n-1.3.1~svn3789/n2n.c:40:1:  [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 multicast_addr[6] = { 0x01, 0x00, 0x05, 0x00, 0x00, 0x00 }; /* First 3 bytes are meaningful */
data/n2n-1.3.1~svn3789/n2n.c:83: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( buf + *offset, s, sizeof(struct peer_addr));
data/n2n-1.3.1~svn3789/n2n.c:123: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( buf+offset, hdr->community_name, COMMUNITY_LEN );
data/n2n-1.3.1~svn3789/n2n.c:126: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( buf+offset, hdr->src_mac, 6 );
data/n2n-1.3.1~svn3789/n2n.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( buf+offset, hdr->dst_mac, 6 );
data/n2n-1.3.1~svn3789/n2n.c:150: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(s, buf + *offset, sizeof(struct peer_addr));
data/n2n-1.3.1~svn3789/n2n.c:187: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( hdr->community_name, (buf + offset), COMMUNITY_LEN );
data/n2n-1.3.1~svn3789/n2n.c:190: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( hdr->src_mac, (buf + offset), 6 );
data/n2n-1.3.1~svn3789/n2n.c:193: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( hdr->dst_mac, (buf + offset), 6 );
data/n2n-1.3.1~svn3789/n2n.c:300:5:  [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[2048];
data/n2n-1.3.1~svn3789/n2n.c:301:5:  [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 out_buf[640];
data/n2n-1.3.1~svn3789/n2n.c:302:5:  [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 theDate[N2N_TRACE_DATESIZE];
data/n2n-1.3.1~svn3789/n2n.c:403:23:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  if(src_mac != NULL) memcpy(hdr->src_mac, src_mac, 6);
data/n2n-1.3.1~svn3789/n2n.c:426: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(hdr.community_name, header->community_name, COMMUNITY_LEN);
data/n2n-1.3.1~svn3789/n2n.c:466:13:  [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).
      len = atoi(packet);
data/n2n-1.3.1~svn3789/n2n.c:487:5:  [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 decompressed[N2N_DECOMPRESS_BUFSIZE];
data/n2n-1.3.1~svn3789/n2n.c:508: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(&packet[N2N_PKT_HDR_SIZE], decompressed, decompressed_len);
data/n2n-1.3.1~svn3789/n2n.c:520:7:  [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( &packet[offsetof(struct n2n_packet_header, public_ip)], from, sizeof(struct sockaddr_in) );
data/n2n-1.3.1~svn3789/n2n.c:584: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(pkt->packet, packet, packet_len);
data/n2n-1.3.1~svn3789/n2n.c:610: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 compressed[1650];
data/n2n-1.3.1~svn3789/n2n.c:620: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(compressed, packet, N2N_PKT_HDR_SIZE);
data/n2n-1.3.1~svn3789/n2n.c:645:7:  [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 send_len[5];
data/n2n-1.3.1~svn3789/n2n.c:662:7:  [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 send_len[5];
data/n2n-1.3.1~svn3789/n2n.c:894: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 tmp[3];
data/n2n-1.3.1~svn3789/n2n.h:155: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 community_name[COMMUNITY_LEN], src_mac[6], dst_mac[6];
data/n2n-1.3.1~svn3789/n2n.h:169: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.
typedef char ipstr_t[32];
data/n2n-1.3.1~svn3789/n2n.h:172: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.
typedef char macstr_t[32];
data/n2n-1.3.1~svn3789/n2n.h:183: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 community_name[16], mac_addr[6];
data/n2n-1.3.1~svn3789/n2n.h:230: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.
extern char broadcast_addr[6];
data/n2n-1.3.1~svn3789/n2n.h:231: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.
extern char multicast_addr[6];
data/n2n-1.3.1~svn3789/supernode.c:61: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( hdr.community_name, reqhdr->community_name, COMMUNITY_LEN);
data/n2n-1.3.1~svn3789/supernode.c:62: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( hdr.dst_mac, reqhdr->src_mac, 6); /* turn it around */
data/n2n-1.3.1~svn3789/supernode.c:87:9:  [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(&scan->public_ip, sender, sizeof(struct peer_addr));
data/n2n-1.3.1~svn3789/supernode.c:88:9:  [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(&scan->private_ip, &hdr->private_ip, sizeof(struct peer_addr));
data/n2n-1.3.1~svn3789/supernode.c:110: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(scan->community_name, hdr->community_name, COMMUNITY_LEN);
data/n2n-1.3.1~svn3789/supernode.c:111: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(&scan->public_ip, sender, sizeof(struct peer_addr));
data/n2n-1.3.1~svn3789/supernode.c:112: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(&scan->private_ip, &hdr->private_ip, sizeof(struct peer_addr));
data/n2n-1.3.1~svn3789/supernode.c:113: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(&scan->mac_addr, hdr->src_mac, 6);
data/n2n-1.3.1~svn3789/supernode.c:257: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(&hdr->public_ip, sender, sizeof(struct peer_addr));
data/n2n-1.3.1~svn3789/supernode.c:356: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 c[1600];
data/n2n-1.3.1~svn3789/supernode.c:389:17:  [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 len = atoi(c);
data/n2n-1.3.1~svn3789/supernode.c:454:20:  [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).
      local_port = atoi(optarg);
data/n2n-1.3.1~svn3789/supernode.c:493: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 packet[2048];
data/n2n-1.3.1~svn3789/tuntap_freebsd.c:34: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 tap_device[N2N_FREEBSD_TAPDEVICE_SIZE];
data/n2n-1.3.1~svn3789/tuntap_freebsd.c:39:18:  [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).
    device->fd = open(tap_device, O_RDWR);
data/n2n-1.3.1~svn3789/tuntap_freebsd.c:50:5:  [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/n2n-1.3.1~svn3789/tuntap_linux.c:36: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(mac_addr, ifr.ifr_ifru.ifru_hwaddr.sa_data, 6);
data/n2n-1.3.1~svn3789/tuntap_linux.c:69: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[N2N_LINUX_SYSTEMCMD_SIZE];
data/n2n-1.3.1~svn3789/tuntap_linux.c:73:16:  [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).
  device->fd = open(tuntap_device, O_RDWR);
data/n2n-1.3.1~svn3789/tuntap_osx.c:34: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 tap_device[N2N_OSX_TAPDEVICE_SIZE];
data/n2n-1.3.1~svn3789/tuntap_osx.c:39:18:  [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).
    device->fd = open(tap_device, O_RDWR);
data/n2n-1.3.1~svn3789/tuntap_osx.c:50:5:  [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/n2n-1.3.1~svn3789/twofish.c:154:11:  [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( tkey, userkey, keysize ); /* The rest will be zeros */
data/n2n-1.3.1~svn3789/twofish.c:158:11:  [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( tkey, TwoFish_DEFAULT_PW, TwoFish_DEFAULT_PW_LEN ); /* if no key defined, use default password */
data/n2n-1.3.1~svn3789/twofish.c:215: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(tfdata->qBlockPlain,in,len);					/* toss the data into it. */
data/n2n-1.3.1~svn3789/twofish.c:217: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(out,tfdata->qBlockCrypt,TwoFish_BLOCK_SIZE);				/* and return what we got */
data/n2n-1.3.1~svn3789/twofish.c:422: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(tfdata->header.magic,TwoFish_MAGIC,TwoFish_MAGIC_LEN); /* set the magic. */
data/n2n-1.3.1~svn3789/twofish.c:495: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(&(tfdata->header),tbuf,TwoFish_BLOCK_SIZE); /* copy first block into header. */
data/n2n-1.3.1~svn3789/twofish.c:507:8:  [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(*out,tbuf+TwoFish_BLOCK_SIZE,elen);	/* copy data into intended output. */
data/n2n-1.3.1~svn3789/twofish.c:687: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(Pn,in,TwoFish_BLOCK_SIZE); /* FK: same here. we work of Pn all the time. */
data/n2n-1.3.1~svn3789/twofish.c:743: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(Pn,in,size);
data/n2n-1.3.1~svn3789/twofish.c:758: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(tfdata->prevCipher,tfdata->qBlockPlain,TwoFish_BLOCK_SIZE);
data/n2n-1.3.1~svn3789/twofish.c:759: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(tfdata->qBlockPlain,p,TwoFish_BLOCK_SIZE);
data/n2n-1.3.1~svn3789/twofish.c:760: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(tfdata->qBlockCrypt,c,TwoFish_BLOCK_SIZE);
data/n2n-1.3.1~svn3789/twofish.c:765: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,tfdata->qBlockPlain,TwoFish_BLOCK_SIZE );
data/n2n-1.3.1~svn3789/twofish.c:766: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(c,tfdata->qBlockCrypt,TwoFish_BLOCK_SIZE );
data/n2n-1.3.1~svn3789/twofish.c:982:5:  [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 outbuf[4096];
data/n2n-1.3.1~svn3789/edge.c:111:22:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    if (p != buffer) strncpy(buffer,p,strlen(p)+1);
data/n2n-1.3.1~svn3789/edge.c:111:39:  [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 (p != buffer) strncpy(buffer,p,strlen(p)+1);
data/n2n-1.3.1~svn3789/edge.c:114: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).
    while(strlen(buffer) && buffer[strlen(buffer)-1]==' ')
data/n2n-1.3.1~svn3789/edge.c:114:36:  [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).
    while(strlen(buffer) && buffer[strlen(buffer)-1]==' ')
data/n2n-1.3.1~svn3789/edge.c:115:14:  [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).
      buffer[strlen(buffer)-1]= '\0';
data/n2n-1.3.1~svn3789/edge.c:123: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).
    if ((strlen(linebuffer)+strlen(buffer)+2)< MAX_CMDLINE_BUFFER_LENGTH) {
data/n2n-1.3.1~svn3789/edge.c:123: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(linebuffer)+strlen(buffer)+2)< MAX_CMDLINE_BUFFER_LENGTH) {
data/n2n-1.3.1~svn3789/edge.c:124:7:  [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(linebuffer, " ", 1);
data/n2n-1.3.1~svn3789/edge.c:125:7:  [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(linebuffer, buffer, strlen(buffer));
data/n2n-1.3.1~svn3789/edge.c:125: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).
      strncat(linebuffer, buffer, strlen(buffer));
data/n2n-1.3.1~svn3789/edge.c:147:30:  [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).
  buffer = (char *)calloc(1, strlen(linebuffer)+2);
data/n2n-1.3.1~svn3789/edge.c:152:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(buffer, linebuffer,strlen(linebuffer));
data/n2n-1.3.1~svn3789/edge.c:152:30:  [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).
  strncpy(buffer, linebuffer,strlen(linebuffer));
data/n2n-1.3.1~svn3789/edge.c:1199: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).
	for(i=0; i<strlen(linebuffer); i++)
data/n2n-1.3.1~svn3789/edge.c:1207: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).
      if ((strlen(linebuffer)+strlen(argv[i])+2) < MAX_CMDLINE_BUFFER_LENGTH) {
data/n2n-1.3.1~svn3789/edge.c:1207:31:  [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(linebuffer)+strlen(argv[i])+2) < MAX_CMDLINE_BUFFER_LENGTH) {
data/n2n-1.3.1~svn3789/edge.c:1208: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(linebuffer, " ", 1);
data/n2n-1.3.1~svn3789/edge.c:1209: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(linebuffer, argv[i], strlen(argv[i]));
data/n2n-1.3.1~svn3789/edge.c:1209:31:  [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(linebuffer, argv[i], strlen(argv[i]));
data/n2n-1.3.1~svn3789/edge.c:1216: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).
  while(strlen(linebuffer) && linebuffer[strlen(linebuffer)-1]==' ')
data/n2n-1.3.1~svn3789/edge.c:1216:42:  [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).
  while(strlen(linebuffer) && linebuffer[strlen(linebuffer)-1]==' ')
data/n2n-1.3.1~svn3789/edge.c:1217: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).
    linebuffer[strlen(linebuffer)-1]= '\0';
data/n2n-1.3.1~svn3789/edge.c:1241: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).
      if(strlen(eee.community_name) > COMMUNITY_LEN)
data/n2n-1.3.1~svn3789/edge.c:1300:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(netmask, optarg, N2N_NETMASK_STR_SIZE);
data/n2n-1.3.1~svn3789/edge.c:1344:58:  [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(edge_init_twofish( &eee, (u_int8_t *)(encrypt_key), strlen(encrypt_key) ) < 0) return(-1);
data/n2n-1.3.1~svn3789/n2n.c:267: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(http_header);
data/n2n-1.3.1~svn3789/n2n.c:327: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).
    while(buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0';
data/n2n-1.3.1~svn3789/n2n.c:327:43:  [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).
    while(buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0';
data/n2n-1.3.1~svn3789/n2n.c:345: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).
	for(i=strlen(file)-1; i>0; i--) if(file[i] == '\\') { i++; break; };
data/n2n-1.3.1~svn3789/tuntap_freebsd.c:110:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return(read(tuntap->fd, buf, len));
data/n2n-1.3.1~svn3789/tuntap_linux.c:81: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, dev, IFNAMSIZ);
data/n2n-1.3.1~svn3789/tuntap_linux.c:111:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return(read(tuntap->fd, buf, len));
data/n2n-1.3.1~svn3789/tuntap_osx.c:110:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return(read(tuntap->fd, buf, len));
data/n2n-1.3.1~svn3789/twofish.c:405: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).
    ilen=strlen(in);	/* ...\0 terminated string and figure len out ourselves... */
data/n2n-1.3.1~svn3789/twofish.c:472: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).
    ilen=strlen(in);	/* ...\0 terminated string and figure len out ourselves... */

ANALYSIS SUMMARY:

Hits = 148
Lines analyzed = 11323 in approximately 0.28 seconds (40055 lines/second)
Physical Source Lines of Code (SLOC) = 9087
Hits@level = [0]  64 [1]  35 [2]  98 [3]   5 [4]  10 [5]   0
Hits@level+ = [0+] 212 [1+] 148 [2+] 113 [3+]  15 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 23.33 [1+] 16.287 [2+] 12.4353 [3+] 1.65071 [4+] 1.10047 [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.