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/egl-wayland-1.1.4/include/wayland-egldevice.h
Examining data/egl-wayland-1.1.4/include/wayland-egldisplay.h
Examining data/egl-wayland-1.1.4/include/wayland-eglhandle.h
Examining data/egl-wayland-1.1.4/include/wayland-eglstream-server.h
Examining data/egl-wayland-1.1.4/include/wayland-eglstream.h
Examining data/egl-wayland-1.1.4/include/wayland-eglsurface.h
Examining data/egl-wayland-1.1.4/include/wayland-eglswap.h
Examining data/egl-wayland-1.1.4/include/wayland-eglutils.h
Examining data/egl-wayland-1.1.4/include/wayland-external-exports.h
Examining data/egl-wayland-1.1.4/include/wayland-thread.h
Examining data/egl-wayland-1.1.4/src/wayland-egldevice.c
Examining data/egl-wayland-1.1.4/src/wayland-egldisplay.c
Examining data/egl-wayland-1.1.4/src/wayland-eglhandle.c
Examining data/egl-wayland-1.1.4/src/wayland-eglstream-server.c
Examining data/egl-wayland-1.1.4/src/wayland-eglstream.c
Examining data/egl-wayland-1.1.4/src/wayland-eglsurface.c
Examining data/egl-wayland-1.1.4/src/wayland-eglswap.c
Examining data/egl-wayland-1.1.4/src/wayland-eglutils.c
Examining data/egl-wayland-1.1.4/src/wayland-external-exports.c
Examining data/egl-wayland-1.1.4/src/wayland-thread.c
Examining data/egl-wayland-1.1.4/wayland-egl/wayland-egl-ext.h

FINAL RESULTS:

data/egl-wayland-1.1.4/src/wayland-egldisplay.c:61:28:  [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       *val      = getenv("EGL_PLATFORM");
data/egl-wayland-1.1.4/src/wayland-eglstream-server.c:342:11:  [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.
    env = getenv("WL_EGLSTREAM_CAP_OVERRIDE");
data/egl-wayland-1.1.4/src/wayland-egldisplay.c:588:9:  [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(attribs2, attribs, nAttribs * sizeof(*attribs2));
data/egl-wayland-1.1.4/src/wayland-eglstream-server.c:78: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 sockAddrStr[NI_MAXHOST];
data/egl-wayland-1.1.4/src/wayland-eglstream-server.c:344:33:  [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).
        int serverCapOverride = atoi(env);
data/egl-wayland-1.1.4/src/wayland-eglsurface.c:353:13:  [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(ctx, &surface->ctx, sizeof(*ctx));
data/egl-wayland-1.1.4/src/wayland-eglsurface.c:629:21:  [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).
        socket[1] = open("/dev/null", O_RDONLY);
data/egl-wayland-1.1.4/src/wayland-eglutils.c:152:13:  [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 msg[256];
data/egl-wayland-1.1.4/include/wayland-eglhandle.h:51:110:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
typedef EGLBoolean  (*PWLEGLFNMAKECURRENTCOREPROC)              (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
data/egl-wayland-1.1.4/src/wayland-eglstream.c:211:17:  [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(WL_EGL_CONN_WAIT_USECS);
data/egl-wayland-1.1.4/src/wayland-eglutils.c:50:30:  [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).
        terminator = where + strlen(extension);

ANALYSIS SUMMARY:

Hits = 11
Lines analyzed = 5011 in approximately 0.19 seconds (27030 lines/second)
Physical Source Lines of Code (SLOC) = 3294
Hits@level = [0]   1 [1]   3 [2]   6 [3]   2 [4]   0 [5]   0
Hits@level+ = [0+]  12 [1+]  11 [2+]   8 [3+]   2 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 3.64299 [1+] 3.3394 [2+] 2.42866 [3+] 0.607165 [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.