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/glew-2.2.0/src/glew.c
Examining data/glew-2.2.0/src/visualinfo.c
Examining data/glew-2.2.0/src/glewinfo.c
Examining data/glew-2.2.0/include/GL/wglew.h
Examining data/glew-2.2.0/include/GL/eglew.h
Examining data/glew-2.2.0/include/GL/glxew.h
Examining data/glew-2.2.0/include/GL/glew.h
Examining data/glew-2.2.0/build/cmake/testbuild/main.c
Examining data/glew-2.2.0/auto/src/eglew_mid.h
Examining data/glew-2.2.0/auto/src/glew_str_head.c
Examining data/glew-2.2.0/auto/src/glewinfo_head.c
Examining data/glew-2.2.0/auto/src/glew_str_egl.c
Examining data/glew-2.2.0/auto/src/glew_head.c
Examining data/glew-2.2.0/auto/src/glew_init_glx.c
Examining data/glew-2.2.0/auto/src/glewinfo_egl.c
Examining data/glew-2.2.0/auto/src/glew_init_gl.c
Examining data/glew-2.2.0/auto/src/wglew_tail.h
Examining data/glew-2.2.0/auto/src/glew_init_egl.c
Examining data/glew-2.2.0/auto/src/glew_head.h
Examining data/glew-2.2.0/auto/src/glxew_tail.h
Examining data/glew-2.2.0/auto/src/glew_str_glx.c
Examining data/glew-2.2.0/auto/src/glxew_mid.h
Examining data/glew-2.2.0/auto/src/glew_init_wgl.c
Examining data/glew-2.2.0/auto/src/khronos_license.h
Examining data/glew-2.2.0/auto/src/glxew_head.h
Examining data/glew-2.2.0/auto/src/wglew_head.h
Examining data/glew-2.2.0/auto/src/eglew_head.h
Examining data/glew-2.2.0/auto/src/glew_license.h
Examining data/glew-2.2.0/auto/src/glew_str_wgl.c
Examining data/glew-2.2.0/auto/src/wglew_mid.h
Examining data/glew-2.2.0/auto/src/glewinfo_wgl.c
Examining data/glew-2.2.0/auto/src/glew_tail.h
Examining data/glew-2.2.0/auto/src/eglew_tail.h
Examining data/glew-2.2.0/auto/src/mesa_license.h
Examining data/glew-2.2.0/auto/src/glewinfo_tail.c
Examining data/glew-2.2.0/auto/src/glew_init_tail.c
Examining data/glew-2.2.0/auto/src/glewinfo_gl.c
Examining data/glew-2.2.0/auto/src/glewinfo_glx.c
Examining data/glew-2.2.0/auto/src/glew_str_tail.c

FINAL RESULTS:

data/glew-2.2.0/auto/src/glew_head.c:109:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(symbolName+1, (const char*)name);
data/glew-2.2.0/include/GL/glew.h:1713:72:  [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.
typedef void* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
data/glew-2.2.0/include/GL/glew.h:4015:90:  [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.
typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access);
data/glew-2.2.0/include/GL/glew.h:4482:78:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access);
data/glew-2.2.0/include/GL/glew.h:4483:123:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
data/glew-2.2.0/include/GL/glew.h:5642:118:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
data/glew-2.2.0/include/GL/glew.h:6610:137:  [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.
typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
data/glew-2.2.0/include/GL/glew.h:8076:76:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
data/glew-2.2.0/include/GL/glew.h:9904:81:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
data/glew-2.2.0/include/GL/glew.h:9905:126:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
data/glew-2.2.0/include/GL/glew.h:11156:121:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
data/glew-2.2.0/include/GL/glew.h:12106:141:  [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.
typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
data/glew-2.2.0/include/GL/glew.h:14203:99:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout);
data/glew-2.2.0/include/GL/glew.h:15044:89:  [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.
typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);
data/glew-2.2.0/include/GL/glew.h:17395:82:  [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.
typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
data/glew-2.2.0/include/GL/glew.h:17397:87:  [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.
typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
data/glew-2.2.0/include/GL/glew.h:18052:93:  [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.
typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
data/glew-2.2.0/include/GL/glew.h:19123:76:  [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.
typedef void * (GLAPIENTRY * PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
data/glew-2.2.0/include/GL/wglew.h:927:76:  [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.
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
data/glew-2.2.0/include/GL/wglew.h:929:122:  [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.
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);
data/glew-2.2.0/src/glew.c:141:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(symbolName+1, (const char*)name);
data/glew-2.2.0/src/visualinfo.c:261:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(t, p);
data/glew-2.2.0/src/visualinfo.c:723:11:  [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(file, value ? " y " : " n ");
data/glew-2.2.0/auto/src/glewinfo_tail.c:97:30:  [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.
    params.display == NULL ? getenv("DISPLAY") : params.display, params.visual);
data/glew-2.2.0/src/glewinfo.c:18519:30:  [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.
    params.display == NULL ? getenv("DISPLAY") : params.display, params.visual);
data/glew-2.2.0/auto/src/glew_init_gl.c:180: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 ext[128];
data/glew-2.2.0/auto/src/glewinfo_tail.c:81:7:  [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).
  f = fopen("glewinfo.txt", "w");
data/glew-2.2.0/include/GL/glxew.h:1330: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 pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
data/glew-2.2.0/include/GL/glxew.h:1334: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 pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
data/glew-2.2.0/include/GL/glxew.h:1341: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 pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
data/glew-2.2.0/include/GL/glxew.h:1347: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 pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
data/glew-2.2.0/src/glew.c:18071: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 ext[128];
data/glew-2.2.0/src/glewinfo.c:18503:7:  [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).
  f = fopen("glewinfo.txt", "w");
data/glew-2.2.0/src/visualinfo.c:165:12:  [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 = fopen("visualinfo.txt", "w");
data/glew-2.2.0/src/visualinfo.c:232: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 t[80];
data/glew-2.2.0/auto/src/glew_head.c:108: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).
  symbolName = malloc(strlen((const char*)name) + 2);
data/glew-2.2.0/auto/src/glewinfo_head.c:60: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).
  for (i=0; i<62-strlen(name); i++) fprintf(f, " ");
data/glew-2.2.0/auto/src/glewinfo_head.c:68:15:  [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(name)+1; i++) fprintf(f, "-");
data/glew-2.2.0/auto/src/glewinfo_head.c:80:20:  [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<60-strlen(name); i++) fprintf(f, " ");
data/glew-2.2.0/include/GL/eglew.h:249:96:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
typedef EGLBoolean  ( * PFNEGLMAKECURRENTPROC) (EGLDisplay  dpy, EGLSurface  draw, EGLSurface  read, EGLContext  ctx);
data/glew-2.2.0/include/GL/glxew.h:302:97:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
data/glew-2.2.0/include/GL/glxew.h:1512:93:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
data/glew-2.2.0/src/glew.c:140: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).
  symbolName = malloc(strlen((const char*)name) + 2);
data/glew-2.2.0/src/glewinfo.c:92: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).
  for (i=0; i<62-strlen(name); i++) fprintf(f, " ");
data/glew-2.2.0/src/glewinfo.c:100:15:  [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(name)+1; i++) fprintf(f, "-");
data/glew-2.2.0/src/glewinfo.c:112:20:  [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<60-strlen(name); i++) fprintf(f, " ");
data/glew-2.2.0/src/visualinfo.c:257: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).
      i = (int)strlen(p);

ANALYSIS SUMMARY:

Hits = 47
Lines analyzed = 88183 in approximately 2.44 seconds (36112 lines/second)
Physical Source Lines of Code (SLOC) = 70763
Hits@level = [0] 293 [1]  12 [2]  10 [3]   2 [4]  23 [5]   0
Hits@level+ = [0+] 340 [1+]  47 [2+]  35 [3+]  25 [4+]  23 [5+]   0
Hits/KSLOC@level+ = [0+] 4.80477 [1+] 0.664189 [2+] 0.494609 [3+] 0.353292 [4+] 0.325029 [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.