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/libx11-protocol-other-perl-31/devel/exe-xi-info.c
Examining data/libx11-protocol-other-perl-31/devel/exe-sync.c
Examining data/libx11-protocol-other-perl-31/devel/render-extension.c
Examining data/libx11-protocol-other-perl-31/devel/encode-xlib.c
Examining data/libx11-protocol-other-perl-31/devel/exe-xv-info.c
Examining data/libx11-protocol-other-perl-31/devel/encode-dump.c
Examining data/libx11-protocol-other-perl-31/devel/exe-screensaver-info.c
Examining data/libx11-protocol-other-perl-31/devel/exe-xv.c
Examining data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib2.c
Examining data/libx11-protocol-other-perl-31/devel/exe-xf86vidmode.c
Examining data/libx11-protocol-other-perl-31/devel/xdga-setmode.c
Examining data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib.c

FINAL RESULTS:

data/libx11-protocol-other-perl-31/devel/exe-screensaver-info.c:36: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 *display_name = getenv("DISPLAY");
data/libx11-protocol-other-perl-31/devel/exe-xi-info.c:31: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 *display_name = getenv("DISPLAY");
data/libx11-protocol-other-perl-31/devel/exe-xv-info.c:27: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 *display_name = getenv("DISPLAY");
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib.c:29:10:  [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 ubuf[500000];
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib.c:31:10:  [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 cbuf[500000];
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib.c:42: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 *fp = fopen ("../tempfile.utf8","r");
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib.c:49: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 *fp = fopen ("../tempfile.ctext","r");
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib.c:74:18:  [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 ("../tempfile-xlib.utf8","w");
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib2.c:31: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[128];
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib2.c:38:8:  [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 ("../tempfile.txt","r");
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib2.c:45: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[128];
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib2.c:49: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 utf8[128];
data/libx11-protocol-other-perl-31/devel/encode-dump.c:48: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 ustr[16];
data/libx11-protocol-other-perl-31/devel/encode-dump.c:51: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 *ulist[2];
data/libx11-protocol-other-perl-31/devel/encode-dump.c:154: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 *fp = fopen ("encode-emacs23.utf8","r");
data/libx11-protocol-other-perl-31/devel/encode-dump.c:156: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[500000];
data/libx11-protocol-other-perl-31/devel/encode-dump.c:161: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 *ulist[2];
data/libx11-protocol-other-perl-31/devel/encode-dump.c:183:18:  [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 ("encode-emacs23xc.ctext","w");
data/libx11-protocol-other-perl-31/devel/encode-dump.c:192:12:  [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.
    static wchar_t wstr[2];
data/libx11-protocol-other-perl-31/devel/encode-dump.c:193:12:  [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.
    static wchar_t *wlist[2];
data/libx11-protocol-other-perl-31/devel/encode-xlib.c:35: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 *fp = fopen ("encode-xlib.utf8","r");
data/libx11-protocol-other-perl-31/devel/encode-xlib.c:37: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[500000];
data/libx11-protocol-other-perl-31/devel/encode-xlib.c:42: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 *ulist[2];
data/libx11-protocol-other-perl-31/devel/encode-xlib.c:64:18:  [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 ("encode-emacs23xc.ctext","w");
data/libx11-protocol-other-perl-31/devel/Encode-X11-xlib2.c:102:23:  [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).
      for (i = 0; i < strlen(tlist[0]); i++) {
data/libx11-protocol-other-perl-31/devel/encode-dump.c:123:24:  [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_prop.nitems = strlen(ctext);
data/libx11-protocol-other-perl-31/devel/encode-dump.c:133:21:  [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).
    for (i = 0; i < strlen(tlist[0]); i++) {
data/libx11-protocol-other-perl-31/devel/encode-dump.c:144: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).
    printf ("XDefaultString [len %d] ", strlen(str));
data/libx11-protocol-other-perl-31/devel/encode-dump.c:145:21:  [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).
    for (i = 0; i < strlen(str); i++) {

ANALYSIS SUMMARY:

Hits = 29
Lines analyzed = 1016 in approximately 0.09 seconds (10922 lines/second)
Physical Source Lines of Code (SLOC) = 666
Hits@level = [0] 118 [1]   5 [2]  21 [3]   3 [4]   0 [5]   0
Hits@level+ = [0+] 147 [1+]  29 [2+]  24 [3+]   3 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 220.721 [1+] 43.5435 [2+] 36.036 [3+] 4.5045 [4+]   0 [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.