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/python-setproctitle-1.2/src/c.h
Examining data/python-setproctitle-1.2/src/setproctitle.c
Examining data/python-setproctitle-1.2/src/spt.h
Examining data/python-setproctitle-1.2/src/spt_config.h
Examining data/python-setproctitle-1.2/src/spt_debug.c
Examining data/python-setproctitle-1.2/src/spt_python.h
Examining data/python-setproctitle-1.2/src/spt_setup.c
Examining data/python-setproctitle-1.2/src/spt_setup.h
Examining data/python-setproctitle-1.2/src/spt_status.c
Examining data/python-setproctitle-1.2/src/spt_status.h
Examining data/python-setproctitle-1.2/src/spt_strlcpy.c
Examining data/python-setproctitle-1.2/tests/pyrun.c
Examining data/python-setproctitle-1.2/tools/prctl_demo.c
Examining data/python-setproctitle-1.2/tools/pttest.c
Examining data/python-setproctitle-1.2/tools/spt_demo.c

FINAL RESULTS:

data/python-setproctitle-1.2/src/spt_debug.c:37: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/python-setproctitle-1.2/src/spt_status.c:396:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(name, "python(%d): %s", _getpid(), ps_buffer);
data/python-setproctitle-1.2/src/spt_debug.c:28: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 *d = getenv("SPT_DEBUG");
data/python-setproctitle-1.2/src/spt_status.c:204: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.
            noenv = getenv("SPT_NOENV");
data/python-setproctitle-1.2/src/setproctitle.c:99: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 title[16] = {'\0'};
data/python-setproctitle-1.2/src/spt_setup.c:264: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 fn[FNLEN];
data/python-setproctitle-1.2/src/spt_status.c:137: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.
static char ps_buffer[PS_BUFFER_SIZE];
data/python-setproctitle-1.2/src/spt_status.c:391:9:  [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[PS_BUFFER_SIZE + 32];
data/python-setproctitle-1.2/src/spt_setup.c:51: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).
        len += strlen(argv[i]) + 1;
data/python-setproctitle-1.2/src/spt_setup.c:138: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).
        ptr += strlen(ptr) + 1;
data/python-setproctitle-1.2/src/spt_setup.c:203:12:  [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).
    ptr -= strlen(arg0);
data/python-setproctitle-1.2/src/spt_status.c:185:41:  [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_of_area = argv[i] + strlen(argv[i]);
data/python-setproctitle-1.2/src/spt_status.c:213:52:  [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_of_area = environ[i] + strlen(environ[i]);
data/python-setproctitle-1.2/src/spt_status.c:315: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).
    ps_buffer_fixed_size = strlen(ps_buffer);
data/python-setproctitle-1.2/src/spt_status.c:357: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).
        pstat(PSTAT_SETCMD, pst, strlen(ps_buffer), 0, 0);
data/python-setproctitle-1.2/src/spt_status.c:371: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).
        buflen = strlen(ps_buffer);
data/python-setproctitle-1.2/src/spt_status.c:431: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).
    *displen = strlen(ps_buffer + ps_buffer_fixed_size);
data/python-setproctitle-1.2/tools/prctl_demo.c:21:5:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    getchar();
data/python-setproctitle-1.2/tools/spt_demo.c:16:5:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    getchar();
data/python-setproctitle-1.2/tools/spt_demo.c:20:5:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    getchar();

ANALYSIS SUMMARY:

Hits = 20
Lines analyzed = 1551 in approximately 0.08 seconds (19292 lines/second)
Physical Source Lines of Code (SLOC) = 831
Hits@level = [0]  12 [1]  12 [2]   4 [3]   2 [4]   2 [5]   0
Hits@level+ = [0+]  32 [1+]  20 [2+]   8 [3+]   4 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 38.5078 [1+] 24.0674 [2+] 9.62696 [3+] 4.81348 [4+] 2.40674 [5+]   0
Dot directories skipped = 2 (--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.