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/moonshot-trust-router-3.5.0+1/common/jansson_iterators.h
Examining data/moonshot-trust-router-3.5.0+1/common/ssl-compat.c
Examining data/moonshot-trust-router-3.5.0+1/common/t_constraint.c
Examining data/moonshot-trust-router-3.5.0+1/common/tests/cfg_test.c
Examining data/moonshot-trust-router-3.5.0+1/common/tests/commtest.c
Examining data/moonshot-trust-router-3.5.0+1/common/tests/dh_test.c
Examining data/moonshot-trust-router-3.5.0+1/common/tests/filt_test.c
Examining data/moonshot-trust-router-3.5.0+1/common/tests/mq_test.c
Examining data/moonshot-trust-router-3.5.0+1/common/tests/name_test.c
Examining data/moonshot-trust-router-3.5.0+1/common/tests/thread_test.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_aaa_server.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_apc.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_comm.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_comm_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config_comms.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config_filters.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config_internal.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config_orgs.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config_realms.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_config_rp_clients.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_constraint.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_debug.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_dh.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_filter.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_filter_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_gss.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_gss_client.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_gss_names.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_idp.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_idp_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_inet_util.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_list.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_mq.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_msg.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_name.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_rand_id.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_rp.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_rp_client.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_rp_client_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_socket.c
Examining data/moonshot-trust-router-3.5.0+1/common/tr_util.c
Examining data/moonshot-trust-router-3.5.0+1/gsscon/gsscon_active.c
Examining data/moonshot-trust-router-3.5.0+1/gsscon/gsscon_common.c
Examining data/moonshot-trust-router-3.5.0+1/gsscon/gsscon_passive.c
Examining data/moonshot-trust-router-3.5.0+1/gsscon/test/gsscon_client.c
Examining data/moonshot-trust-router-3.5.0+1/gsscon/test/gsscon_server.c
Examining data/moonshot-trust-router-3.5.0+1/include/gsscon.h
Examining data/moonshot-trust-router-3.5.0+1/include/mon.h
Examining data/moonshot-trust-router-3.5.0+1/include/mon_internal.h
Examining data/moonshot-trust-router-3.5.0+1/include/mons_handlers.h
Examining data/moonshot-trust-router-3.5.0+1/include/ssl-compat.h
Examining data/moonshot-trust-router-3.5.0+1/include/tid_internal.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_aaa_server.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_apc.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_cfgwatch.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_comm.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_config.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_constraint_internal.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_debug.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_event.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_filter.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_gss.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_gss_client.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_gss_names.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_idp.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_inet_util.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_json_util.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_list.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_mon.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_mq.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_msg.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_name_internal.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_rand_id.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_rp.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_rp_client.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_socket.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_tid.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_trp.h
Examining data/moonshot-trust-router-3.5.0+1/include/tr_util.h
Examining data/moonshot-trust-router-3.5.0+1/include/trp_internal.h
Examining data/moonshot-trust-router-3.5.0+1/include/trp_peer.h
Examining data/moonshot-trust-router-3.5.0+1/include/trp_ptable.h
Examining data/moonshot-trust-router-3.5.0+1/include/trp_route.h
Examining data/moonshot-trust-router-3.5.0+1/include/trp_rtable.h
Examining data/moonshot-trust-router-3.5.0+1/include/trust_router/tid.h
Examining data/moonshot-trust-router-3.5.0+1/include/trust_router/tr_constraint.h
Examining data/moonshot-trust-router-3.5.0+1/include/trust_router/tr_dh.h
Examining data/moonshot-trust-router-3.5.0+1/include/trust_router/tr_name.h
Examining data/moonshot-trust-router-3.5.0+1/include/trust_router/tr_versioning.h
Examining data/moonshot-trust-router-3.5.0+1/include/trust_router/trp.h
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_common.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_req.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_req_decode.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_req_encode.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_resp.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_resp_decode.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_resp_encode.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mon_tr_msg.c
Examining data/moonshot-trust-router-3.5.0+1/mon/monc.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mons.c
Examining data/moonshot-trust-router-3.5.0+1/mon/mons_handlers.c
Examining data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_req_decode.c
Examining data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_req_encode.c
Examining data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_resp_encode.c
Examining data/moonshot-trust-router-3.5.0+1/tests/t_libtr_tid_la.c
Examining data/moonshot-trust-router-3.5.0+1/tid/example/tidc_main.c
Examining data/moonshot-trust-router-3.5.0+1/tid/example/tids_main.c
Examining data/moonshot-trust-router-3.5.0+1/tid/tid_req.c
Examining data/moonshot-trust-router-3.5.0+1/tid/tid_resp.c
Examining data/moonshot-trust-router-3.5.0+1/tid/tid_tr_msg.c
Examining data/moonshot-trust-router-3.5.0+1/tid/tidc.c
Examining data/moonshot-trust-router-3.5.0+1/tid/tids.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_cfgwatch.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_event.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_main.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_mon.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_tid.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_tid_mons.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_trp.c
Examining data/moonshot-trust-router-3.5.0+1/tr/tr_trp_mons.c
Examining data/moonshot-trust-router-3.5.0+1/tr/trmon_main.c
Examining data/moonshot-trust-router-3.5.0+1/tr/trpc_main.c
Examining data/moonshot-trust-router-3.5.0+1/trp/msgtst.c
Examining data/moonshot-trust-router-3.5.0+1/trp/test/ptbl_test.c
Examining data/moonshot-trust-router-3.5.0+1/trp/test/rtbl_test.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_conn.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_filter.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_peer.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_peer_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_ptable.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_ptable_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_req.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_route.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_route_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_rtable.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_rtable_encoders.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_tr_msg.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trp_upd.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trpc.c
Examining data/moonshot-trust-router-3.5.0+1/trp/trps.c

FINAL RESULTS:

data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:65:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, ap);
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:74: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, LOG_MAX_MESSAGE_SIZE, fmt, ap_copy);
data/moonshot-trust-router-3.5.0+1/common/tr_idp_encoders.c:90:7:  [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(aaa_servers, s_aaa[ii]);
data/moonshot-trust-router-3.5.0+1/common/tr_idp_encoders.c:113:7:  [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(apcs, s_apc[ii]);
data/moonshot-trust-router-3.5.0+1/common/tr_name.c:62:7:  [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(new->buf, name);
data/moonshot-trust-router-3.5.0+1/trp/trp_rtable_encoders.c:119:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    p+=sprintf(p, "%s%s", tbl_strings[ii], lineterm);
data/moonshot-trust-router-3.5.0+1/common/tests/filt_test.c:144:5:  [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(fname, "r");
data/moonshot-trust-router-3.5.0+1/common/tr_dh.c:45:10:  [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 tr_2048_dhprime[2048/8] = {
data/moonshot-trust-router-3.5.0+1/common/tr_filter.c:140:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char name[FILTER_FIELD_NAME_LEN+1];
data/moonshot-trust-router-3.5.0+1/common/tr_idp_encoders.c:92:9:  [2] (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 string.
        strcat(aaa_servers, ", ");
data/moonshot-trust-router-3.5.0+1/common/tr_idp_encoders.c:115:9:  [2] (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 string.
        strcat(apcs, ", ");
data/moonshot-trust-router-3.5.0+1/common/tr_inet_util.c:53:12:  [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 buf[sizeof(struct in6_addr)];
data/moonshot-trust-router-3.5.0+1/common/tr_name.c:215: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(s, src->buf, (size_t) src->len);
data/moonshot-trust-router-3.5.0+1/common/tr_rand_id.c:50:12:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      p += sprintf(p, "%02x", *(bytes++));
data/moonshot-trust-router-3.5.0+1/common/tr_rand_id.c:78:12:  [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 bytes[ID_LENGTH];
data/moonshot-trust-router-3.5.0+1/common/tr_socket.c:191: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 peeraddr_string[INET6_ADDRSTRLEN];
data/moonshot-trust-router-3.5.0+1/common/tr_socket.c:193: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 err[TR_S_A_MAX_ERR_LEN];
data/moonshot-trust-router-3.5.0+1/gsscon/gsscon_common.c:306: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 (unencryptedToken, outputBuffer.value, outputBuffer.length);
data/moonshot-trust-router-3.5.0+1/gsscon/gsscon_passive.c:260: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 (clientPrincipal, nameToken.value, nameToken.length);
data/moonshot-trust-router-3.5.0+1/gsscon/test/gsscon_server.c:187:13:  [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[1024];
data/moonshot-trust-router-3.5.0+1/include/tr_msg.h:60: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 msg_type_label[MSG_TYPE_LABEL_LEN+1]; /* +1 to allow space for null term */
data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_req_decode.c:60: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).
  FILE *f = fopen(filename, "r");
data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_req_encode.c:54: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).
  FILE *f = fopen(filename, "r");
data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_resp_encode.c:61: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).
  FILE *f = fopen(filename, "r");
data/moonshot-trust-router-3.5.0+1/tid/example/tidc_main.c:94: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[c_keylen * 2 + 1];
data/moonshot-trust-router-3.5.0+1/tid/example/tids_main.c:59:12:  [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 rand_buf[32];
data/moonshot-trust-router-3.5.0+1/tid/example/tids_main.c:180: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 key_id[12];
data/moonshot-trust-router-3.5.0+1/tid/example/tids_main.c:361:23:  [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).
    arguments->port = atoi(arg);
data/moonshot-trust-router-3.5.0+1/tid/tid_req.c:219: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(new_req, orig_req, sizeof(TID_REQ));
data/moonshot-trust-router-3.5.0+1/tid/tids.c:531: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 result[TIDS_MAX_MESSAGE_LEN] = {0};
data/moonshot-trust-router-3.5.0+1/trp/msgtst.c:67:5:  [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(argv[1], "r");
data/moonshot-trust-router-3.5.0+1/common/tests/filt_test.c:122:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  assert(msg= tr_msg_decode(NULL, encoded, strlen(encoded)));
data/moonshot-trust-router-3.5.0+1/common/tests/thread_test.c:70:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(msg_dly);
data/moonshot-trust-router-3.5.0+1/common/tests/thread_test.c:151:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(2000000);
data/moonshot-trust-router-3.5.0+1/common/tr_config.c:458:5:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  n=strlen(dent->d_name);
data/moonshot-trust-router-3.5.0+1/common/tr_constraint.c:165: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(str);
data/moonshot-trust-router-3.5.0+1/common/tr_constraint.c:166: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).
  if (0 == (wc_len = strlen(wc_str)))
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:44: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).
#define LOG_OVERHEAD strlen(LOG_PREFIX)
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:103: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).
    size_t len = strlen(key)
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:104: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).
               + strlen(val)
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:105: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).
               + strlen(LOG_FIELD_SEP)
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:106: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).
               + strlen(LOG_KV_SEP)
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:139: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).
    if ((len + strlen(array[i]) + LOG_OVERHEAD) <= LOG_MAX_MESSAGE_SIZE) {
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:141: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).
      len += strlen(array[i]);
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:151: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(buf) + strlen(array[i]) + LOG_OVERHEAD + 1) <= LOG_MAX_MESSAGE_SIZE) {
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:151:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((strlen(buf) + strlen(array[i]) + LOG_OVERHEAD + 1) <= LOG_MAX_MESSAGE_SIZE) {
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:153: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(buf, array[i], remain);
data/moonshot-trust-router-3.5.0+1/common/tr_debug.c:154: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).
      remain -= strlen(array[i]);
data/moonshot-trust-router-3.5.0+1/common/tr_filter.c:191:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(handler->name, name, FILTER_FIELD_NAME_LEN);
data/moonshot-trust-router-3.5.0+1/common/tr_gss.c:114:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  nameBuffer.length = strlen(nameBuffer.value);
data/moonshot-trust-router-3.5.0+1/common/tr_gss.c:195:59:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  err = gsscon_write_encrypted_token (conn, gssctx, resp, strlen(resp) + 1);
data/moonshot-trust-router-3.5.0+1/common/tr_gss.c:261: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).
    req_len = strlen(req_str);
data/moonshot-trust-router-3.5.0+1/common/tr_gss_client.c:115:77:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  err = gsscon_write_encrypted_token(gssc->conn, *(gssc->gss_ctx), req_buf, strlen(req_buf));
data/moonshot-trust-router-3.5.0+1/common/tr_idp_encoders.c:81:27:  [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).
      aaa_servers_strlen+=strlen(s_aaa[ii]);
data/moonshot-trust-router-3.5.0+1/common/tr_idp_encoders.c:104: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).
      apcs_strlen+=strlen(s_apc[ii]);
data/moonshot-trust-router-3.5.0+1/common/tr_inet_util.c:79: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(s);
data/moonshot-trust-router-3.5.0+1/common/tr_msg.c:124:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(handler->msg_type_label, msg_type_label, MSG_TYPE_LABEL_LEN);
data/moonshot-trust-router-3.5.0+1/common/tr_name.c:59: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).
    new->len = (int) strlen(name);
data/moonshot-trust-router-3.5.0+1/common/tr_name.c:82:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(to->buf, from->buf, (size_t) from->len);
data/moonshot-trust-router-3.5.0+1/common/tr_name.c:206:5:  [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(dest, src->buf, used_len);
data/moonshot-trust-router-3.5.0+1/common/tr_name.c:238:3:  [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(s, n1->buf, (size_t) n1->len);
data/moonshot-trust-router-3.5.0+1/common/tr_name.c:239:3:  [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(s, n2->buf, (size_t) n2->len);
data/moonshot-trust-router-3.5.0+1/gsscon/gsscon_common.c:129:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            count = read (inSocket, ptr, inBufferLength - bytesRead);
data/moonshot-trust-router-3.5.0+1/gsscon/test/gsscon_server.c:203: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).
                                                 buffer, strlen (buffer) + 1);
data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_req_decode.c:73:12:  [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.
static int equal(MON_REQ *r1, MON_REQ *r2)
data/moonshot-trust-router-3.5.0+1/mon/tests/test_mon_req_decode.c:105:10:  [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.
  assert(equal(req, expected));
data/moonshot-trust-router-3.5.0+1/tid/example/tids_main.c:63: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(out_id, "key-", len);
data/moonshot-trust-router-3.5.0+1/tid/example/tids_main.c:95: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).
    for (i=0; i<strlen(s); i++) {
data/moonshot-trust-router-3.5.0+1/tid/tid_req.c:306: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).
    len = strlen(hostname);
data/moonshot-trust-router-3.5.0+1/tid/tids.c:242:45:  [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(resp_buf) + 1);
data/moonshot-trust-router-3.5.0+1/tid/tids.c:452:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (write(result_fd, response_message, strlen(response_message) + 1) < 0)
data/moonshot-trust-router-3.5.0+1/tid/tids.c:574:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    result_len = read(tp.read_fd, result, TIDS_MAX_MESSAGE_LEN);
data/moonshot-trust-router-3.5.0+1/tr/tr_main.c:67:5:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  n=strlen(s);
data/moonshot-trust-router-3.5.0+1/tr/trpc_main.c:184:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1000000);
data/moonshot-trust-router-3.5.0+1/trp/test/rtbl_test.c:113: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).
        assert(len==strlen(apc[ii]));
data/moonshot-trust-router-3.5.0+1/trp/test/rtbl_test.c:117: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).
        assert(len==strlen(realm[jj]));
data/moonshot-trust-router-3.5.0+1/trp/test/rtbl_test.c:121: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).
        assert(len==strlen(peer[kk]));
data/moonshot-trust-router-3.5.0+1/trp/test/rtbl_test.c:125: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).
        assert(len==strlen(realm[jj]));
data/moonshot-trust-router-3.5.0+1/trp/test/rtbl_test.c:131: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).
        assert(len==strlen(peer[kk]));
data/moonshot-trust-router-3.5.0+1/trp/trp_rtable.c:79:10:  [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.
  return equal;
data/moonshot-trust-router-3.5.0+1/trp/trp_rtable_encoders.c:105: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).
        len+=strlen(tbl_strings[ii_tbl]);
data/moonshot-trust-router-3.5.0+1/trp/trp_rtable_encoders.c:115: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).
  len += tbl_size*strlen(lineterm); /* space for line terminations*/
data/moonshot-trust-router-3.5.0+1/trp/trpc.c:220: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).
                                         strlen(msg_content))) {

ANALYSIS SUMMARY:

Hits = 83
Lines analyzed = 33714 in approximately 0.89 seconds (37865 lines/second)
Physical Source Lines of Code (SLOC) = 21681
Hits@level = [0] 140 [1]  52 [2]  25 [3]   0 [4]   6 [5]   0
Hits@level+ = [0+] 223 [1+]  83 [2+]  31 [3+]   6 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 10.2855 [1+] 3.82824 [2+] 1.42982 [3+] 0.27674 [4+] 0.27674 [5+]   0
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.