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/tio-1.32/src/include/tio/error.h
Examining data/tio-1.32/src/include/tio/print.h
Examining data/tio-1.32/src/include/tio/tty.h
Examining data/tio-1.32/src/include/tio/options.h
Examining data/tio-1.32/src/include/tio/time.h
Examining data/tio-1.32/src/include/tio/log.h
Examining data/tio-1.32/src/options.c
Examining data/tio-1.32/src/main.c
Examining data/tio-1.32/src/log.c
Examining data/tio-1.32/src/setspeed2.c
Examining data/tio-1.32/src/tty.c
Examining data/tio-1.32/src/error.c
Examining data/tio-1.32/src/time.c

FINAL RESULTS:

data/tio-1.32/src/include/tio/error.h:31:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   snprintf (error[0], 1000, format, ## args);
data/tio-1.32/src/include/tio/error.h:34:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   snprintf (error[1], 1000, format, ## args);
data/tio-1.32/src/include/tio/print.h:49:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   fprintf (stdout, "[debug] " format, ## args)
data/tio-1.32/src/include/tio/print.h:51:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   fprintf (stdout, "" format, ## args)
data/tio-1.32/src/tty.c:504:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
        if (access(option.tty_device, R_OK) == 0)
data/tio-1.32/src/tty.c:639:25:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                        fprintf(stdout, ANSI_COLOR_GRAY "[%s] " ANSI_COLOR_RESET, current_time());
data/tio-1.32/src/options.c:129:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "b:d:f:s:p:o:netl:m:vh", long_options, &option_index);
data/tio-1.32/src/error.c:31:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char error[2][1000];
data/tio-1.32/src/include/tio/error.h:28:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char error[2][1000];
data/tio-1.32/src/log.c:36:10:  [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).
    fp = fopen(filename, "w+");
data/tio-1.32/src/time.c:31: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.
    static char time_string[20];
data/tio-1.32/src/tty.c:200: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(&stdin_new, &stdin_old, sizeof(stdin_old));
data/tio-1.32/src/tty.c:240: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(&stdout_new, &stdout_old, sizeof(stdout_old));
data/tio-1.32/src/tty.c:549:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open(option.tty_device, O_RDWR | O_NOCTTY | O_NONBLOCK );
data/tio-1.32/src/tty.c:551:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open(option.tty_device, O_RDWR | O_NOCTTY);
data/tio-1.32/src/options.c:221: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).
    if (strlen(option.tty_device) == 0)
data/tio-1.32/src/tty.c:485:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            status = read(STDIN_FILENO, &input_char, 1);
data/tio-1.32/src/tty.c:631:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if (read(fd, &input_char, 1) > 0)
data/tio-1.32/src/tty.c:677:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                status = read(STDIN_FILENO, &input_char, 1);

ANALYSIS SUMMARY:

Hits = 19
Lines analyzed = 1514 in approximately 0.05 seconds (30907 lines/second)
Physical Source Lines of Code (SLOC) = 959
Hits@level = [0]  40 [1]   4 [2]   8 [3]   1 [4]   6 [5]   0
Hits@level+ = [0+]  59 [1+]  19 [2+]  15 [3+]   7 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 61.5224 [1+] 19.8123 [2+] 15.6413 [3+] 7.29927 [4+] 6.25652 [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.