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/mosh-1.3.2/src/crypto/ae.h
Examining data/mosh-1.3.2/src/crypto/base64.cc
Examining data/mosh-1.3.2/src/crypto/base64.h
Examining data/mosh-1.3.2/src/crypto/byteorder.h
Examining data/mosh-1.3.2/src/crypto/crypto.cc
Examining data/mosh-1.3.2/src/crypto/crypto.h
Examining data/mosh-1.3.2/src/crypto/ocb.cc
Examining data/mosh-1.3.2/src/crypto/prng.h
Examining data/mosh-1.3.2/src/examples/benchmark.cc
Examining data/mosh-1.3.2/src/examples/decrypt.cc
Examining data/mosh-1.3.2/src/examples/encrypt.cc
Examining data/mosh-1.3.2/src/examples/ntester.cc
Examining data/mosh-1.3.2/src/examples/parse.cc
Examining data/mosh-1.3.2/src/examples/termemu.cc
Examining data/mosh-1.3.2/src/frontend/mosh-client.cc
Examining data/mosh-1.3.2/src/frontend/stmclient.cc
Examining data/mosh-1.3.2/src/frontend/stmclient.h
Examining data/mosh-1.3.2/src/frontend/terminaloverlay.cc
Examining data/mosh-1.3.2/src/frontend/terminaloverlay.h
Examining data/mosh-1.3.2/src/frontend/mosh-server.cc
Examining data/mosh-1.3.2/src/network/compressor.cc
Examining data/mosh-1.3.2/src/network/compressor.h
Examining data/mosh-1.3.2/src/network/network.cc
Examining data/mosh-1.3.2/src/network/network.h
Examining data/mosh-1.3.2/src/network/networktransport-impl.h
Examining data/mosh-1.3.2/src/network/networktransport.h
Examining data/mosh-1.3.2/src/network/transportfragment.cc
Examining data/mosh-1.3.2/src/network/transportfragment.h
Examining data/mosh-1.3.2/src/network/transportsender-impl.h
Examining data/mosh-1.3.2/src/network/transportsender.h
Examining data/mosh-1.3.2/src/network/transportstate.h
Examining data/mosh-1.3.2/src/statesync/completeterminal.cc
Examining data/mosh-1.3.2/src/statesync/completeterminal.h
Examining data/mosh-1.3.2/src/statesync/user.cc
Examining data/mosh-1.3.2/src/statesync/user.h
Examining data/mosh-1.3.2/src/terminal/parser.cc
Examining data/mosh-1.3.2/src/terminal/parser.h
Examining data/mosh-1.3.2/src/terminal/parseraction.cc
Examining data/mosh-1.3.2/src/terminal/parseraction.h
Examining data/mosh-1.3.2/src/terminal/parserstate.cc
Examining data/mosh-1.3.2/src/terminal/parserstate.h
Examining data/mosh-1.3.2/src/terminal/parserstatefamily.h
Examining data/mosh-1.3.2/src/terminal/parsertransition.h
Examining data/mosh-1.3.2/src/terminal/terminal.cc
Examining data/mosh-1.3.2/src/terminal/terminal.h
Examining data/mosh-1.3.2/src/terminal/terminaldispatcher.cc
Examining data/mosh-1.3.2/src/terminal/terminaldispatcher.h
Examining data/mosh-1.3.2/src/terminal/terminaldisplay.cc
Examining data/mosh-1.3.2/src/terminal/terminaldisplay.h
Examining data/mosh-1.3.2/src/terminal/terminaldisplayinit.cc
Examining data/mosh-1.3.2/src/terminal/terminalfunctions.cc
Examining data/mosh-1.3.2/src/terminal/terminaluserinput.cc
Examining data/mosh-1.3.2/src/terminal/terminaluserinput.h
Examining data/mosh-1.3.2/src/terminal/terminalframebuffer.cc
Examining data/mosh-1.3.2/src/terminal/terminalframebuffer.h
Examining data/mosh-1.3.2/src/tests/base64.cc
Examining data/mosh-1.3.2/src/tests/base64_vector.h
Examining data/mosh-1.3.2/src/tests/encrypt-decrypt.cc
Examining data/mosh-1.3.2/src/tests/inpty.cc
Examining data/mosh-1.3.2/src/tests/is-utf8-locale.cc
Examining data/mosh-1.3.2/src/tests/nonce-incr.cc
Examining data/mosh-1.3.2/src/tests/ocb-aes.cc
Examining data/mosh-1.3.2/src/tests/test_utils.cc
Examining data/mosh-1.3.2/src/tests/test_utils.h
Examining data/mosh-1.3.2/src/util/dos_assert.h
Examining data/mosh-1.3.2/src/util/fatal_assert.h
Examining data/mosh-1.3.2/src/util/locale_utils.cc
Examining data/mosh-1.3.2/src/util/locale_utils.h
Examining data/mosh-1.3.2/src/util/pty_compat.cc
Examining data/mosh-1.3.2/src/util/pty_compat.h
Examining data/mosh-1.3.2/src/util/select.cc
Examining data/mosh-1.3.2/src/util/select.h
Examining data/mosh-1.3.2/src/util/shared.h
Examining data/mosh-1.3.2/src/util/swrite.cc
Examining data/mosh-1.3.2/src/util/swrite.h
Examining data/mosh-1.3.2/src/util/timestamp.cc
Examining data/mosh-1.3.2/src/util/timestamp.h

FINAL RESULTS:

data/mosh-1.3.2/src/examples/termemu.cc:138:10:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if ( execvp( argv[ 0 ], argv ) < 0 ) {
data/mosh-1.3.2/src/frontend/mosh-server.cc:349:42:  [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.
      int unused __attribute((unused)) = system( "locale" );
data/mosh-1.3.2/src/frontend/mosh-server.cc:583:10:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if ( execvp( command_path.c_str(), command_argv ) < 0 ) {
data/mosh-1.3.2/src/frontend/stmclient.cc:89:40:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    int unused __attribute((unused)) = system( "locale" );
data/mosh-1.3.2/src/frontend/stmclient.cc:193:3:  [4] (format) swprintf:
  Potential format string problem (CWE-134). Make format string constant.
  swprintf( tmp, 128, L"Nothing received from server on UDP port %s.", port.c_str() );
data/mosh-1.3.2/src/frontend/stmclient.cc:564:9:  [4] (format) swprintf:
  Potential format string problem (CWE-134). Make format string constant.
        swprintf( tmp, 128, L"Crypto exception: %s", e.what() );
data/mosh-1.3.2/src/frontend/terminaloverlay.cc:244:5:  [4] (format) swprintf:
  Potential format string problem (CWE-134). Make format string constant.
    swprintf( tmp, 128, L"mosh: Last %s %s ago.%s", explanation,
data/mosh-1.3.2/src/frontend/terminaloverlay.cc:249:5:  [4] (format) swprintf:
  Potential format string problem (CWE-134). Make format string constant.
    swprintf( tmp, 128, L"mosh: %ls%s", message.c_str(), keystroke_str );
data/mosh-1.3.2/src/frontend/terminaloverlay.cc:251:5:  [4] (format) swprintf:
  Potential format string problem (CWE-134). Make format string constant.
    swprintf( tmp, 128, L"mosh: %ls (%s without %s.)%s", message.c_str(),
data/mosh-1.3.2/src/frontend/terminaloverlay.h:187:7:  [4] (format) swprintf:
  Potential format string problem (CWE-134). Make format string constant.
      swprintf( tmp, 128, L"%s", s.c_str() );
data/mosh-1.3.2/src/tests/encrypt-decrypt.cc:107:7:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      printf( DUMP_NAME_FMT NONCE_FMT "\n", "nonce", nonce_int );
data/mosh-1.3.2/src/tests/encrypt-decrypt.cc:118:7:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      printf( DUMP_NAME_FMT NONCE_FMT "\n", "dec nonce", decrypted.nonce.val() );
data/mosh-1.3.2/src/tests/inpty.cc:95:10:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if ( execvp( argv[1], argv + 1 ) < 0 ) {
data/mosh-1.3.2/src/tests/test_utils.cc:39:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  printf( DUMP_NAME_FMT, name );
data/mosh-1.3.2/src/util/pty_compat.cc:109:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy( name, slave_name );
data/mosh-1.3.2/src/examples/termemu.cc:125:22:  [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.
      my_argv[ 0 ] = getenv( "SHELL" );
data/mosh-1.3.2/src/frontend/mosh-client.cc:128:18:  [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.
  while ( (opt = getopt( argc, argv, "#:cv" )) != -1 ) {
data/mosh-1.3.2/src/frontend/mosh-client.cc:166:19:  [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.
  char *env_key = getenv( "MOSH_KEY" );
data/mosh-1.3.2/src/frontend/mosh-client.cc:173:24:  [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.
  char *predict_mode = getenv( "MOSH_PREDICTION_DISPLAY" );
data/mosh-1.3.2/src/frontend/mosh-server.cc:143:32:  [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.
  const char *SSH_CONNECTION = getenv( "SSH_CONNECTION" );
data/mosh-1.3.2/src/frontend/mosh-server.cc:209:20:  [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.
    while ( (opt = getopt( argc - 1, argv + 1, "@:i:p:c:svl:" )) != -1 ) {
data/mosh-1.3.2/src/frontend/mosh-server.cc:283:25:  [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.
    const char *shell = getenv( "SHELL" );
data/mosh-1.3.2/src/frontend/mosh-server.cc:372:25:  [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.
  char *timeout_envar = getenv( "MOSH_SERVER_NETWORK_TMOUT" );
data/mosh-1.3.2/src/frontend/mosh-server.cc:386:24:  [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.
  char *signal_envar = getenv( "MOSH_SERVER_SIGNAL_TMOUT" );
data/mosh-1.3.2/src/frontend/mosh-server.cc:921:22:  [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.
  const char *home = getenv( "HOME" );
data/mosh-1.3.2/src/frontend/stmclient.cc:121: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.
  if ( !getenv( "MOSH_TITLE_NOPREFIX" ) ) {
data/mosh-1.3.2/src/frontend/stmclient.cc:127:26:  [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 ( (escape_key_env = getenv( "MOSH_ESCAPE_KEY" )) != NULL ) {
data/mosh-1.3.2/src/terminal/terminaldisplayinit.cc:131:29:  [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.
    const char *term_type = getenv( "TERM" );
data/mosh-1.3.2/src/terminal/terminaldisplayinit.cc:144:11:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if ( !getenv( "MOSH_NO_TERM_INIT" ) ) {
data/mosh-1.3.2/src/util/locale_utils.cc:62:26:  [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 ( const char *all = getenv( "LC_ALL" ) ) {
data/mosh-1.3.2/src/util/locale_utils.cc:64:35:  [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.
  } else if ( const char *ctype = getenv( "LC_CTYPE" ) ) {
data/mosh-1.3.2/src/util/locale_utils.cc:66:34:  [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.
  } else if ( const char *lang = getenv( "LANG" ) ) {
data/mosh-1.3.2/src/crypto/crypto.cc:107: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( m_data, data, len );
data/mosh-1.3.2/src/crypto/crypto.cc:146: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 base64[ 24 ];
data/mosh-1.3.2/src/crypto/crypto.cc:181: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( bytes + 4, &val_net, 8 );
data/mosh-1.3.2/src/crypto/crypto.cc: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( &ret, bytes + 4, 8 );
data/mosh-1.3.2/src/crypto/crypto.cc:198: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( bytes + 4, s_bytes, 8 );
data/mosh-1.3.2/src/crypto/crypto.cc:209: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( plaintext_buffer.data(), plaintext.text.data(), pt_len );
data/mosh-1.3.2/src/crypto/crypto.cc:210: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( nonce_buffer.data(), plaintext.nonce.data(), Nonce::NONCE_LEN );
data/mosh-1.3.2/src/crypto/crypto.cc:269: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( ciphertext_buffer.data(), str + 8, body_len );
data/mosh-1.3.2/src/crypto/crypto.cc:270: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( nonce_buffer.data(), nonce.data(), Nonce::NONCE_LEN );
data/mosh-1.3.2/src/crypto/crypto.h:93:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char key[ 16 ];
data/mosh-1.3.2/src/crypto/crypto.h:108: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 bytes[ NONCE_LEN ];
data/mosh-1.3.2/src/crypto/ocb.cc:110:55:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	#pragma intrinsic(_byteswap_uint64, _BitScanForward, memcpy)
data/mosh-1.3.2/src/crypto/ocb.cc:158:25:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		static const unsigned char tz_table[32] =
data/mosh-1.3.2/src/crypto/ocb.cc:958: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(tmp.u8, adp+k, remaining);
data/mosh-1.3.2/src/crypto/ocb.cc:1123: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(tmp.u8, ptp+k, remaining);
data/mosh-1.3.2/src/crypto/ocb.cc:1137: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(ctp+k, tmp.u8, remaining);
data/mosh-1.3.2/src/crypto/ocb.cc:1163:14:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	            memcpy((char *)tag, &offset, OCB_TAG_LEN);
data/mosh-1.3.2/src/crypto/ocb.cc:1165:14:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	            memcpy((char *)tag, &offset, ctx->tag_len);
data/mosh-1.3.2/src/crypto/ocb.cc:1169:14:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	            memcpy((char *)ct + pt_len, &offset, OCB_TAG_LEN);
data/mosh-1.3.2/src/crypto/ocb.cc:1172:14:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	            memcpy((char *)ct + pt_len, &offset, ctx->tag_len);
data/mosh-1.3.2/src/crypto/ocb.cc:1340: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(tmp.u8,ctp+k,remaining);
data/mosh-1.3.2/src/crypto/ocb.cc:1343: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(ptp+k, tmp.u8, remaining);
data/mosh-1.3.2/src/crypto/ocb.cc:1424:46:  [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.
        printf("%02X", (unsigned)(((unsigned char *)p)[i]));
data/mosh-1.3.2/src/crypto/ocb.cc:1484:13:  [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(next,ct,(size_t)i+16);
data/mosh-1.3.2/src/crypto/ocb.cc:1488:13:  [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(next,ct,(size_t)i+16);
data/mosh-1.3.2/src/crypto/ocb.cc:1492:13:  [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(next,ct,16);
data/mosh-1.3.2/src/crypto/ocb.cc:1498:13:  [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(next,ct,(size_t)i+16);
data/mosh-1.3.2/src/crypto/ocb.cc:1504:13:  [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(next,ct,(size_t)i+16);
data/mosh-1.3.2/src/crypto/ocb.cc:1510:13:  [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(next,ct,16);
data/mosh-1.3.2/src/examples/benchmark.cc:73: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).
      iterations = atoi(argv[1]);
data/mosh-1.3.2/src/examples/benchmark.cc:80: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).
      width = atoi(argv[2]);
data/mosh-1.3.2/src/examples/benchmark.cc:81: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).
      height = atoi(argv[3]);
data/mosh-1.3.2/src/examples/parse.cc:104: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 *my_argv[ 2 ];
data/mosh-1.3.2/src/examples/parse.cc:168: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[ buf_size ];
data/mosh-1.3.2/src/examples/parse.cc: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 buf[ buf_size ];
data/mosh-1.3.2/src/examples/termemu.cc:119: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 *my_argv[ 2 ];
data/mosh-1.3.2/src/examples/termemu.cc:246:34:  [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).
  swrite( STDOUT_FILENO, display.open().c_str() );
data/mosh-1.3.2/src/examples/termemu.cc:259: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 buf[ buf_size ];
data/mosh-1.3.2/src/examples/termemu.cc:282: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 buf[ buf_size ];
data/mosh-1.3.2/src/frontend/mosh-server.cc:279: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 *my_argv[ 2 ];
data/mosh-1.3.2/src/frontend/mosh-server.cc:473: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).
    nullfd = open( "/dev/null", O_RDWR );
data/mosh-1.3.2/src/frontend/mosh-server.cc:492: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 utmp_entry[ 64 ] = { 0 };
data/mosh-1.3.2/src/frontend/mosh-server.cc:575: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 linebuf[81];
data/mosh-1.3.2/src/frontend/mosh-server.cc:759:6:  [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 host[ NI_MAXHOST ];
data/mosh-1.3.2/src/frontend/mosh-server.cc:767:6:  [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[ 64 + NI_MAXHOST ];
data/mosh-1.3.2/src/frontend/mosh-server.cc:789: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[ buf_size ];
data/mosh-1.3.2/src/frontend/mosh-server.cc:856:4:  [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[ 64 ];
data/mosh-1.3.2/src/frontend/mosh-server.cc:896:16:  [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 *motd = fopen( filename, "r" );
data/mosh-1.3.2/src/frontend/mosh-server.cc:903: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[ BUFSIZE ];
data/mosh-1.3.2/src/frontend/stmclient.cc:75:34:  [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).
  swrite( STDOUT_FILENO, display.open().c_str() );
data/mosh-1.3.2/src/frontend/stmclient.cc:118:34:  [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).
  swrite( STDOUT_FILENO, display.open().c_str() );
data/mosh-1.3.2/src/frontend/stmclient.cc:174: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 escape_pass_name_buf[16];
data/mosh-1.3.2/src/frontend/stmclient.cc:175: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 escape_key_name_buf[16];
data/mosh-1.3.2/src/frontend/stmclient.cc:192:3:  [2] (buffer) wchar_t:
  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.
  wchar_t tmp[ 128 ];
data/mosh-1.3.2/src/frontend/stmclient.cc:303: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[ buf_size ];
data/mosh-1.3.2/src/frontend/stmclient.cc:563:9:  [2] (buffer) wchar_t:
  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.
        wchar_t tmp[ 128 ];
data/mosh-1.3.2/src/frontend/terminaloverlay.cc:177: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[ 128 ];
data/mosh-1.3.2/src/frontend/terminaloverlay.cc:218:3:  [2] (buffer) wchar_t:
  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.
  wchar_t tmp[ 128 ];
data/mosh-1.3.2/src/frontend/terminaloverlay.h:179: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 tmp[ 128 ];
data/mosh-1.3.2/src/frontend/terminaloverlay.h:186:7:  [2] (buffer) wchar_t:
  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.
      wchar_t tmp[ 128 ];
data/mosh-1.3.2/src/network/network.cc:306: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( &local_addr.sa, ai.res->ai_addr, local_addr_len );
data/mosh-1.3.2/src/network/network.cc:344: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 host[ NI_MAXHOST ], serv[ NI_MAXSERV ];
data/mosh-1.3.2/src/network/network.cc:393: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( &remote_addr.sa, ai.res->ai_addr, remote_addr_len );
data/mosh-1.3.2/src/network/network.cc:474: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_payload[ Session::RECEIVE_MTU ];
data/mosh-1.3.2/src/network/network.cc:475: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_control[ Session::RECEIVE_MTU ];
data/mosh-1.3.2/src/network/network.cc:574: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 host[ NI_MAXHOST ], serv[ NI_MAXSERV ];
data/mosh-1.3.2/src/network/network.cc:599: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 serv[ NI_MAXSERV ];
data/mosh-1.3.2/src/network/transportsender-impl.h:315: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 chaff[ CHAFF_MAX ];
data/mosh-1.3.2/src/terminal/parser.h:76: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[ BUF_SIZE ];
data/mosh-1.3.2/src/terminal/terminaldispatcher.cc:159: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 assum[ 64 ];
data/mosh-1.3.2/src/terminal/terminaldispatcher.cc:218: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 ctrlstr[ 2 ] = { (char)act->ch, 0 };
data/mosh-1.3.2/src/terminal/terminaldisplay.cc:48: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).
std::string Display::open() const
data/mosh-1.3.2/src/terminal/terminaldisplay.cc:65: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[ 64 ];
data/mosh-1.3.2/src/terminal/terminaldisplay.cc:330: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[ 64 ];
data/mosh-1.3.2/src/terminal/terminaldisplay.cc:512: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[ 64 ];
data/mosh-1.3.2/src/terminal/terminaldisplay.h:82:17:  [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).
    std::string open() const;
data/mosh-1.3.2/src/terminal/terminalframebuffer.cc:530: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 col[ 8 ];
data/mosh-1.3.2/src/terminal/terminalframebuffer.cc:537: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 col[ 8 ];
data/mosh-1.3.2/src/terminal/terminalframebuffer.cc:545: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 col[ 64 ];
data/mosh-1.3.2/src/terminal/terminalframebuffer.cc:551: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 col[ 64 ];
data/mosh-1.3.2/src/terminal/terminalframebuffer.cc:587: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[64];
data/mosh-1.3.2/src/terminal/terminalframebuffer.h:152: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 tmp[MB_LEN_MAX];
data/mosh-1.3.2/src/terminal/terminalframebuffer.h:167: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 tmp[MB_LEN_MAX];
data/mosh-1.3.2/src/terminal/terminalfunctions.cc:447: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 cpr[ 32 ];
data/mosh-1.3.2/src/terminal/terminaluserinput.cc:72: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 translated_cursor[ 2 ] = { '[', act->c };
data/mosh-1.3.2/src/terminal/terminaluserinput.cc:75: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 original_cursor[ 2 ] = { 'O', act->c };
data/mosh-1.3.2/src/tests/base64.cc:59: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 encoded[25];
data/mosh-1.3.2/src/tests/base64_vector.h:1:41:  [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.
struct base64_test_row { const unsigned char native[17]; const char encoded[25]; };
data/mosh-1.3.2/src/tests/base64_vector.h:1:64:  [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.
struct base64_test_row { const unsigned char native[17]; const char encoded[25]; };
data/mosh-1.3.2/src/tests/inpty.cc:103: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[ 1024 ];
data/mosh-1.3.2/src/tests/ocb-aes.cc:499: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( acc, out.data(), s.len() + TAG_LEN );
data/mosh-1.3.2/src/tests/ocb-aes.cc:508: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( acc, out.data(), s.len() + TAG_LEN );
data/mosh-1.3.2/src/tests/ocb-aes.cc:517: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( acc, out.data(), TAG_LEN );
data/mosh-1.3.2/src/util/dos_assert.h:43: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[ 2048 ];
data/mosh-1.3.2/src/util/pty_compat.cc:63: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).
  master = open( PTY_DEVICE, O_RDWR | O_NOCTTY );
data/mosh-1.3.2/src/util/pty_compat.cc:88:11:  [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).
  slave = open( slave_name, O_RDWR | O_NOCTTY );
data/mosh-1.3.2/src/util/pty_compat.cc:151:20:  [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).
        dummy_fd = open (slave_name, O_RDWR);
data/mosh-1.3.2/src/crypto/crypto.cc:58: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).
       || ( end != str + strlen( str ) ) ) {
data/mosh-1.3.2/src/crypto/prng.h:66:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    randfile.read( static_cast<char *>( dest ), size );
data/mosh-1.3.2/src/examples/ntester.cc:91:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ( sel.read( network_fd ) ) {
data/mosh-1.3.2/src/examples/ntester.cc:141:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ( sel.read( STDIN_FILENO ) ) {
data/mosh-1.3.2/src/examples/ntester.cc:143:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	  fatal_assert( read( STDIN_FILENO, &x, 1 ) == 1 );
data/mosh-1.3.2/src/examples/ntester.cc:151:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	  if ( sel.read( *it ) ) {
data/mosh-1.3.2/src/examples/parse.cc:152:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ( sel.read( STDIN_FILENO ) ) {
data/mosh-1.3.2/src/examples/parse.cc:156:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    } else if ( sel.read( fd ) ) {
data/mosh-1.3.2/src/examples/parse.cc:170:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t bytes_read = read( src, buf, buf_size );
data/mosh-1.3.2/src/examples/parse.cc:186:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t bytes_read = read( fd, buf, buf_size );
data/mosh-1.3.2/src/examples/termemu.cc:257:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ( sel.read( STDIN_FILENO ) ) {
data/mosh-1.3.2/src/examples/termemu.cc:262:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ssize_t bytes_read = read( STDIN_FILENO, buf, buf_size );
data/mosh-1.3.2/src/examples/termemu.cc:280:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    } else if ( sel.read( fd ) ) {
data/mosh-1.3.2/src/examples/termemu.cc:285:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ssize_t bytes_read = read( fd, buf, buf_size );
data/mosh-1.3.2/src/frontend/mosh-client.cc:159:53:  [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).
       && ( strspn( desired_port, "0123456789" ) != strlen( desired_port ) ) ) {
data/mosh-1.3.2/src/frontend/mosh-server.cc:159:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if ( ( local_interface_IP.length() > strlen( IPv6_prefix ) )
data/mosh-1.3.2/src/frontend/mosh-server.cc:160:72:  [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).
       && ( 0 == strncasecmp( local_interface_IP.c_str(), IPv6_prefix, strlen( IPv6_prefix ) ) ) ) {
data/mosh-1.3.2/src/frontend/mosh-server.cc:161: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).
    return local_interface_IP.substr( strlen( IPv6_prefix ) );
data/mosh-1.3.2/src/frontend/mosh-server.cc:701:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ( sel.read( network_fd ) ) {
data/mosh-1.3.2/src/frontend/mosh-server.cc:786:53:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ( (!network.shutdown_in_progress()) && sel.read( host_fd ) ) {
data/mosh-1.3.2/src/frontend/mosh-server.cc:792:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ssize_t bytes_read = read( host_fd, buf, buf_size );
data/mosh-1.3.2/src/frontend/stmclient.cc:128: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( escape_key_env ) == 1 ) {
data/mosh-1.3.2/src/frontend/stmclient.cc:150: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).
    } else if ( strlen( escape_key_env ) == 0 ) {
data/mosh-1.3.2/src/frontend/stmclient.cc:306:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t bytes_read = read( fd, buf, buf_size );
data/mosh-1.3.2/src/frontend/stmclient.cc:460:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ( sel.read( *it ) ) {
data/mosh-1.3.2/src/frontend/stmclient.cc:471:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ( sel.read( STDIN_FILENO ) ) {
data/mosh-1.3.2/src/terminal/terminaldisplayinit.cc:137: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).
                           strlen( title_term_types[ i ] ) ) ) {
data/mosh-1.3.2/src/tests/inpty.cc:104:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t bytes_read = read( master, buf, sizeof( buf ) );
data/mosh-1.3.2/src/tests/ocb-aes.cc:58:13:  [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 bool equal( const AlignedBuffer &a, const AlignedBuffer &b ) {
data/mosh-1.3.2/src/tests/ocb-aes.cc:95:17:  [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.
  fatal_assert( equal( expected_ciphertext, observed_ciphertext ) );
data/mosh-1.3.2/src/tests/ocb-aes.cc:124:19:  [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.
    fatal_assert( equal( expected_plaintext, observed_plaintext ) );
data/mosh-1.3.2/src/tests/ocb-aes.cc:532:17:  [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.
  fatal_assert( equal( out, correct ) );
data/mosh-1.3.2/src/util/select.h:188:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bool read( int fd )
data/mosh-1.3.2/src/util/swrite.cc:42: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).
  ssize_t bytes_to_write = ( len >= 0 ) ? len : (ssize_t) strlen( str );

ANALYSIS SUMMARY:

Hits = 163
Lines analyzed = 16528 in approximately 0.49 seconds (33922 lines/second)
Physical Source Lines of Code (SLOC) = 10777
Hits@level = [0] 178 [1]  34 [2]  97 [3]  17 [4]  15 [5]   0
Hits@level+ = [0+] 341 [1+] 163 [2+] 129 [3+]  32 [4+]  15 [5+]   0
Hits/KSLOC@level+ = [0+] 31.6415 [1+] 15.1248 [2+] 11.9699 [3+] 2.96929 [4+] 1.39185 [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.