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/ttygif-1.5.0/io.c
Examining data/ttygif-1.5.0/io.h
Examining data/ttygif-1.5.0/string_builder.c
Examining data/ttygif-1.5.0/string_builder.h
Examining data/ttygif-1.5.0/ttygif.c
Examining data/ttygif-1.5.0/ttyrec.h
Examining data/ttygif-1.5.0/utils.c
Examining data/ttygif-1.5.0/utils.h

FINAL RESULTS:

data/ttygif-1.5.0/ttygif.c:128:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (system(cmd) != 0) {
data/ttygif-1.5.0/ttygif.c:138:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    if (sprintf(cmd,
data/ttygif-1.5.0/ttygif.c:147:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        if (sprintf(cmd,
data/ttygif-1.5.0/ttygif.c:167:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    if (sprintf(cmd, "xwd -id %s -out %s", o.window_id, img_path) < 0) {
data/ttygif-1.5.0/ttygif.c:242:17:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            if (sprintf(arg_buffer, " -delay %f %s", delay * 0.1, img_path) < 0) {
data/ttygif-1.5.0/ttygif.c:248:17:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            if (sprintf(img_path, "%s/%d.%s", o.img_dir, index, o.img_ext) < 0) {
data/ttygif-1.5.0/ttygif.c:356:13:  [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(VERSION"\n");
data/ttygif-1.5.0/utils.c:10: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, format, args);
data/ttygif-1.5.0/utils.c:18:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(command,
data/ttygif-1.5.0/utils.c:22:16:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    FILE *fp = popen(command, "r");
data/ttygif-1.5.0/utils.c:39:16:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    FILE *fp = popen(command, "r");
data/ttygif-1.5.0/ttygif.c:307:21:  [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.
    options.debug = getenv("TTYGIF_DEBUG") != NULL;
data/ttygif-1.5.0/ttygif.c:320: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 *terminal_app = getenv("TERM_PROGRAM");
data/ttygif-1.5.0/ttygif.c:333: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.
    options.window_id = getenv("WINDOWID");
data/ttygif-1.5.0/io.c:123:14:  [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 *fp = fopen(path, mode);
data/ttygif-1.5.0/ttygif.c:136: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 cmd [256];
data/ttygif-1.5.0/ttygif.c:162: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 cmd [256];
data/ttygif-1.5.0/ttygif.c:205: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 img_path[256] = "";
data/ttygif-1.5.0/ttygif.c:206: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 arg_buffer[256] = "";
data/ttygif-1.5.0/ttygif.c:328: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 window_id_buffer[256];
data/ttygif-1.5.0/ttygif.c:329:5:  [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.
    sprintf(window_id_buffer, "%d", window_id);
data/ttygif-1.5.0/utils.c:17: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 command[1024];
data/ttygif-1.5.0/utils.c:44: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 buffer[1024];
data/ttygif-1.5.0/string_builder.c:43:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(s, sb->s, sb->size);
data/ttygif-1.5.0/ttygif.c:165: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(50000);
data/ttygif-1.5.0/ttygif.c:321:34:  [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 (terminal_app == NULL || !strlen(terminal_app)) {
data/ttygif-1.5.0/ttygif.c:334:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (options.window_id == NULL || !strlen(options.window_id)) {

ANALYSIS SUMMARY:

Hits = 27
Lines analyzed = 734 in approximately 0.03 seconds (23024 lines/second)
Physical Source Lines of Code (SLOC) = 546
Hits@level = [0]  21 [1]   4 [2]   9 [3]   3 [4]  11 [5]   0
Hits@level+ = [0+]  48 [1+]  27 [2+]  23 [3+]  14 [4+]  11 [5+]   0
Hits/KSLOC@level+ = [0+] 87.9121 [1+] 49.4505 [2+] 42.1245 [3+] 25.641 [4+] 20.1465 [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.