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/freetts-1.2.2/demo/freetts/ClientServer/client.c

FINAL RESULTS:

data/freetts-1.2.2/demo/freetts/ClientServer/client.c:274:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(tts_text_str, "TTS\n%d\n%s\n", sample_rate, tts_text);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:436:20:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    audio_device = getenv(AUDIO_DEVICE_ENV_VAR);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:127: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).
    server_port = atoi(argv[2]);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:130: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).
    sample_rate = atoi(argv[3]);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:133: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).
    metrics = atoi(argv[4]);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:176:3:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  bcopy((char *)hp->h_addr, (char *)&server.sin_addr, hp->h_length);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:210: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[STR_BUFFER_SIZE];
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:211: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 input_buffer[TEXT_INPUT_BUFFER_SIZE];
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:261: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 tts_text_str[TEXT_INPUT_BUFFER_SIZE];
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:264: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 number_samples_str[STR_BUFFER_SIZE];
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:300:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      number_samples = atoi(number_samples_str);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:433:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  if ((audio_fd = open(audio_device, O_WRONLY)) == -1) {
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:439:23:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      if ((audio_fd = open(audio_device, O_RDWR)) == -1) {
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:228: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 (is_string_nonempty(input_buffer, strlen(input_buffer)) &&
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:268: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).
  input_length = strlen(tts_text);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:276: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).
  text_length = strlen(tts_text_str);
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:353:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((nread = read(sock_fd, socket_buffer, bytes_to_read)) == -1) {
data/freetts-1.2.2/demo/freetts/ClientServer/client.c:391:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(sock_fd, &rc, 1);

ANALYSIS SUMMARY:

Hits = 18
Lines analyzed = 487 in approximately 0.13 seconds (3735 lines/second)
Physical Source Lines of Code (SLOC) = 241
Hits@level = [0]   7 [1]   5 [2]  11 [3]   1 [4]   1 [5]   0
Hits@level+ = [0+]  25 [1+]  18 [2+]  13 [3+]   2 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 103.734 [1+] 74.6888 [2+] 53.9419 [3+] 8.29876 [4+] 4.14938 [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.