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/oclgrind-19.10/src/CL/cl.h
Examining data/oclgrind-19.10/src/CL/cl_d3d10.h
Examining data/oclgrind-19.10/src/CL/cl_d3d11.h
Examining data/oclgrind-19.10/src/CL/cl_dx9_media_sharing.h
Examining data/oclgrind-19.10/src/CL/cl_egl.h
Examining data/oclgrind-19.10/src/CL/cl_ext.h
Examining data/oclgrind-19.10/src/CL/cl_gl.h
Examining data/oclgrind-19.10/src/CL/cl_gl_ext.h
Examining data/oclgrind-19.10/src/CL/cl_platform.h
Examining data/oclgrind-19.10/src/CL/opencl.h
Examining data/oclgrind-19.10/src/core/Context.cpp
Examining data/oclgrind-19.10/src/core/Context.h
Examining data/oclgrind-19.10/src/core/Kernel.cpp
Examining data/oclgrind-19.10/src/core/Kernel.h
Examining data/oclgrind-19.10/src/core/KernelInvocation.cpp
Examining data/oclgrind-19.10/src/core/KernelInvocation.h
Examining data/oclgrind-19.10/src/core/Memory.cpp
Examining data/oclgrind-19.10/src/core/Memory.h
Examining data/oclgrind-19.10/src/core/Plugin.cpp
Examining data/oclgrind-19.10/src/core/Plugin.h
Examining data/oclgrind-19.10/src/core/Program.h
Examining data/oclgrind-19.10/src/core/Queue.cpp
Examining data/oclgrind-19.10/src/core/Queue.h
Examining data/oclgrind-19.10/src/core/WorkGroup.cpp
Examining data/oclgrind-19.10/src/core/WorkGroup.h
Examining data/oclgrind-19.10/src/core/WorkItem.cpp
Examining data/oclgrind-19.10/src/core/WorkItem.h
Examining data/oclgrind-19.10/src/core/common.cpp
Examining data/oclgrind-19.10/src/core/half.cpp
Examining data/oclgrind-19.10/src/core/half.h
Examining data/oclgrind-19.10/src/core/Program.cpp
Examining data/oclgrind-19.10/src/core/WorkItemBuiltins.cpp
Examining data/oclgrind-19.10/src/core/common.h
Examining data/oclgrind-19.10/src/kernel/Simulation.cpp
Examining data/oclgrind-19.10/src/kernel/Simulation.h
Examining data/oclgrind-19.10/src/kernel/oclgrind-kernel.cpp
Examining data/oclgrind-19.10/src/plugins/InstructionCounter.cpp
Examining data/oclgrind-19.10/src/plugins/InstructionCounter.h
Examining data/oclgrind-19.10/src/plugins/InteractiveDebugger.cpp
Examining data/oclgrind-19.10/src/plugins/InteractiveDebugger.h
Examining data/oclgrind-19.10/src/plugins/Logger.cpp
Examining data/oclgrind-19.10/src/plugins/Logger.h
Examining data/oclgrind-19.10/src/plugins/MemCheck.cpp
Examining data/oclgrind-19.10/src/plugins/MemCheck.h
Examining data/oclgrind-19.10/src/plugins/RaceDetector.cpp
Examining data/oclgrind-19.10/src/plugins/RaceDetector.h
Examining data/oclgrind-19.10/src/plugins/Uninitialized.cpp
Examining data/oclgrind-19.10/src/plugins/Uninitialized.h
Examining data/oclgrind-19.10/src/runtime/async_queue.cpp
Examining data/oclgrind-19.10/src/runtime/async_queue.h
Examining data/oclgrind-19.10/src/runtime/runtime.cpp
Examining data/oclgrind-19.10/src/runtime/oclgrind.cpp
Examining data/oclgrind-19.10/src/runtime/icd.h
Examining data/oclgrind-19.10/tests/apps/image/image.c
Examining data/oclgrind-19.10/tests/apps/vecadd/vecadd.c
Examining data/oclgrind-19.10/tests/common/common.c
Examining data/oclgrind-19.10/tests/common/common.h
Examining data/oclgrind-19.10/tests/runtime/build_program.c
Examining data/oclgrind-19.10/tests/runtime/inc/nospace/header.h
Examining data/oclgrind-19.10/tests/runtime/inc/with space/header.h
Examining data/oclgrind-19.10/tests/runtime/kernel_scope_local_mem_usage.c
Examining data/oclgrind-19.10/tests/runtime/map_buffer.c
Examining data/oclgrind-19.10/tests/runtime/multqueues.c
Examining data/oclgrind-19.10/tests/runtime/sampler.c

FINAL RESULTS:

data/oclgrind-19.10/src/runtime/oclgrind.cpp:429:7:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
  if (readlink("/proc/self/exe", exepath, PATH_MAX) == -1)
data/oclgrind-19.10/src/CL/cl_platform.h:77:79:  [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.
        #warning  This path should never happen outside of internal operating system development.  AvailabilityMacros do not function correctly here!
data/oclgrind-19.10/src/core/Program.cpp:305:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(tmpOptions, "%s %s", mainOptions, extraOptions);
data/oclgrind-19.10/src/core/Program.cpp:398:11:  [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(pchdir + length, pch_relative);
data/oclgrind-19.10/src/core/Program.cpp:407:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(pch, "%s/opencl-c-%s-%d.pch",
data/oclgrind-19.10/src/core/Program.cpp:549:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(tempCL, "%s/oclgrind_%lX.cl", tmpdir, m_uid);
data/oclgrind-19.10/src/core/Program.cpp:550:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(tempIR, "%s/oclgrind_%lX.ll", tmpdir, m_uid);
data/oclgrind-19.10/src/core/Program.cpp:551:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(tempBC, "%s/oclgrind_%lX.bc", tmpdir, m_uid);
data/oclgrind-19.10/src/core/WorkItemBuiltins.cpp:3316:19:  [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(format.c_str(), SARGV(arg, i));
data/oclgrind-19.10/src/core/WorkItemBuiltins.cpp:3330:19:  [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(format.c_str(), UARGV(arg, i));
data/oclgrind-19.10/src/core/WorkItemBuiltins.cpp:3347:19:  [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(format.c_str(), FARGV(arg, i));
data/oclgrind-19.10/src/core/WorkItemBuiltins.cpp:3358:19:  [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(format.c_str(), NULL);
data/oclgrind-19.10/src/core/WorkItemBuiltins.cpp:3374:19:  [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(format.c_str(), str.c_str());
data/oclgrind-19.10/src/core/common.h:32:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf _snprintf
data/oclgrind-19.10/src/core/common.h:32:18:  [4] (format) _snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf _snprintf
data/oclgrind-19.10/src/core/common.h:226:16:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
      int sz = snprintf(NULL, 0, format, ##__VA_ARGS__); \
data/oclgrind-19.10/src/core/common.h:228:7:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
      sprintf(str, format, ##__VA_ARGS__);               \
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:241:61:  [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.
size_t RaceDetector::getAccessWorkGroup(const MemoryAccess& access) const
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:243:7:  [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.
  if (access.isWorkItem())
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:246:12:  [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.
    return access.getEntity() / (wgsize.x*wgsize.y*wgsize.z);
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:249:12:  [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.
    return access.getEntity();
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:253:47:  [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.
                          const MemoryAccess& access) const
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:255:7:  [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.
  if (access.isLoad())
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:258:21:  [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.
      record.load = access;
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:260:12:  [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.
  else if (access.isStore())
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:263:22:  [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.
      record.store = access;
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:364:16:  [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.
  MemoryAccess access(workGroup, workItem, storeData != NULL, atomic);
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:385:7:  [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.
      access.setStoreData(storeData[i]);
data/oclgrind-19.10/src/plugins/RaceDetector.cpp:387:33:  [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.
    insert(accesses[address+i], access);
data/oclgrind-19.10/src/plugins/RaceDetector.h:130:51:  [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.
    size_t getAccessWorkGroup(const MemoryAccess& access) const;
data/oclgrind-19.10/src/plugins/RaceDetector.h:133:59:  [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.
    void insert(AccessRecord& record, const MemoryAccess& access) const;
data/oclgrind-19.10/src/runtime/oclgrind.cpp:189:7:  [4] (shell) execvp:
  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 (execvp(appArgs[0], appArgs) == -1)
data/oclgrind-19.10/src/core/Context.cpp:102: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 *dynamicPlugins = getenv("OCLGRIND_PLUGINS");
data/oclgrind-19.10/src/core/Program.cpp:299: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.
  const char *extraOptions = getenv("OCLGRIND_BUILD_OPTIONS");
data/oclgrind-19.10/src/core/Program.cpp:362:34:  [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 *pchdirOverride = getenv("OCLGRIND_PCH_DIR");
data/oclgrind-19.10/src/core/Program.cpp:539:26:  [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 *tmpdir = getenv("TEMP");
data/oclgrind-19.10/src/core/Program.cpp:787:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(now());
data/oclgrind-19.10/src/core/common.cpp:287: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.
    const char *value = getenv(var);
data/oclgrind-19.10/src/core/common.cpp:293: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.
    const char *value = getenv(var);
data/oclgrind-19.10/src/kernel/Simulation.cpp:126:16:  [3] (random) setstate:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  m_lineBuffer.setstate(ios_base::eofbit);
data/oclgrind-19.10/src/plugins/Logger.cpp:30: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.
  const char *logfile = getenv("OCLGRIND_LOG");
data/oclgrind-19.10/src/runtime/oclgrind.cpp:164:34:  [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 *oldLdLibraryPath = getenv(LD_LIBRARY_PATH_ENV);
data/oclgrind-19.10/src/runtime/oclgrind.cpp:175: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.
  const char *oldLdPreload = getenv(LD_PRELOAD_ENV);
data/oclgrind-19.10/src/runtime/oclgrind.cpp:436:3:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
  realpath(exepath, path);
data/oclgrind-19.10/src/runtime/oclgrind.cpp:443: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.
  const char *testing = getenv("OCLGRIND_TESTING");
data/oclgrind-19.10/tests/apps/vecadd/vecadd.c:55:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(0);
data/oclgrind-19.10/tests/runtime/map_buffer.c:32:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(0);
data/oclgrind-19.10/tests/runtime/map_buffer.c:92:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(0);
data/oclgrind-19.10/tests/runtime/map_buffer.c:152:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(0);
data/oclgrind-19.10/tests/runtime/map_buffer.c:206:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(0);
data/oclgrind-19.10/tests/runtime/multqueues.c:130:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(0);
data/oclgrind-19.10/tests/runtime/sampler.c:62:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(0);
data/oclgrind-19.10/src/core/Memory.cpp:83:5:  [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(buffer->data, initData, size);
data/oclgrind-19.10/src/core/Memory.cpp:287:3:  [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(dst_buffer->data + dst_offset,
data/oclgrind-19.10/src/core/Memory.cpp:429:3:  [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(dest, src->data + offset, size);
data/oclgrind-19.10/src/core/Memory.cpp:462:3:  [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(dst->data + offset, source, size);
data/oclgrind-19.10/src/core/Program.cpp:371:7:  [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 libpath[4096];
data/oclgrind-19.10/src/core/Program.cpp:555:8:  [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).
    cl.open(tempCL);
data/oclgrind-19.10/src/core/Program.cpp:744:3:  [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(binary, str.c_str(), str.length());
data/oclgrind-19.10/src/core/Queue.h:96:7:  [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(pattern, p, sz);
data/oclgrind-19.10/src/core/Queue.h:116:7:  [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(origin, o, sizeof(size_t)*3);
data/oclgrind-19.10/src/core/Queue.h:117:7:  [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(region, r, sizeof(size_t)*3);
data/oclgrind-19.10/src/core/Queue.h:122:7:  [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(color, col, ps);
data/oclgrind-19.10/src/core/Queue.h:153: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(args, a, sz);
data/oclgrind-19.10/src/core/WorkItem.cpp:103:7:  [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(v.data, value->second.data, v.size*v.num);
data/oclgrind-19.10/src/core/WorkItem.cpp:809:3:  [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(result.data, operand.data, result.size*result.num);
data/oclgrind-19.10/src/core/WorkItem.cpp:928:3:  [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(result.data, operand.data + result.size*index, result.size);
data/oclgrind-19.10/src/core/WorkItem.cpp:961:3:  [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(result.data, getOperand(agg).data + offset, getTypeSize(type));
data/oclgrind-19.10/src/core/WorkItem.cpp:1196:3:  [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(result.data, vector.data, result.size*result.num);
data/oclgrind-19.10/src/core/WorkItem.cpp:1197:3:  [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(result.data + index*result.size, element.data, result.size);
data/oclgrind-19.10/src/core/WorkItem.cpp:1207:3:  [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(result.data, getOperand(agg).data, result.size*result.num);
data/oclgrind-19.10/src/core/WorkItem.cpp:1234:3:  [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(result.data + offset, getOperand(value).data,
data/oclgrind-19.10/src/core/WorkItem.cpp:1305:3:  [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(result.data, getOperand(value).data, result.size*result.num);
data/oclgrind-19.10/src/core/WorkItem.cpp:1382:5:  [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(result.data + i*result.size,
data/oclgrind-19.10/src/core/WorkItem.cpp:1442:5:  [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(result.data + i*result.size,
data/oclgrind-19.10/src/core/WorkItem.cpp:1679:15:  [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 len = atoi(fullname.c_str()+2);
data/oclgrind-19.10/src/core/WorkItemBuiltins.cpp:2983:7:  [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(result.data, src.data, src.size*src.num);
data/oclgrind-19.10/src/core/common.cpp:276:7:  [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(result.data, data, size*num);
data/oclgrind-19.10/src/core/common.cpp:958:5:  [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(dest.data, source.data, dest.size*dest.num);
data/oclgrind-19.10/src/kernel/Simulation.cpp:127:13:  [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).
  m_simfile.open(filename);
data/oclgrind-19.10/src/kernel/Simulation.cpp:154:14:  [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).
    progFile.open(progFileName.c_str(), ios_base::in | ios_base::binary);
data/oclgrind-19.10/src/kernel/Simulation.cpp:162: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 magic[2] = {0,0};
data/oclgrind-19.10/src/kernel/Simulation.cpp:665:3:  [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(result, &data[0], size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:156:19:  [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 len = atoi(fullname.c_str() + 2);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:411: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(newShadow.data, newElemShadow.data, result.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:456: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(newIntShadow.data, newElemIntShadow.data, 4);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:457: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(newShadow.data, newElemShadow.data, result.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:495: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(newShadow.data, newElemShadow.data, result.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:522:17:  [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(newShadow.data + i*newShadow.size, v.data, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:527:17:  [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(newShadow.data + i*newShadow.size, shadow.data + srcOffset, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:563:17:  [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(newShadow.data + i*newShadow.size, v.data, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:568:17:  [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(newShadow.data + i*newShadow.size, shadow[src].data + srcOffset, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:613:17:  [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(newShadow.data + i*newShadow.size, v.data, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:618:17:  [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(newShadow.data + i*newShadow.size, shadow[src].data + srcOffset, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:662:17:  [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(newShadow.data + i*newShadow.size, pv.data, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:666:17:  [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(newShadow.data + i*newShadow.size, cv.data, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:720:17:  [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(halfShadow.data + i*halfShadow.size, pv.data, halfShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:724:17:  [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(halfShadow.data + i*halfShadow.size, cv.data, halfShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:928:31:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        case llvm::Intrinsic::memcpy:
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1092: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(newShadow.data, shadow.data, newShadow.size*newShadow.num);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1180:21:  [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(v.data, origShadowData, size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1216: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(newShadow.data, vectorShadow.data + newShadow.size*index, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1252: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(ResShadow.data, shadowContext.getValue(workItem, Agg).data + offset, getTypeSize(type));
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1331: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(newShadow.data, vectorShadow.data, newShadow.size*newShadow.num);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1332: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(newShadow.data + index*newShadow.size, elementShadow.data, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1345: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(newShadow.data, shadowContext.getValue(workItem, agg).data, newShadow.size*newShadow.num);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1371: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(newShadow.data + offset, shadowContext.getValue(workItem, value).data, getTypeSize(value->getType()));
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1532:21:  [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(newShadow.data + i*newShadow.size,
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1602:21:  [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(newShadow.data + i*newShadow.size, pv.data, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1616:17:  [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(newShadow.data + i*newShadow.size, v.data + srcOffset, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:1676:17:  [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(newShadow.data+i*newShadow.size, shadow.data+i*shadow.size, newShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:2204: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(vecShadow.data + offset, elemShadow.data, vecShadow.size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:2388: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(dst, m_map.at(index)->data + offset, size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:2393: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(dst, v.data, size);
data/oclgrind-19.10/src/plugins/Uninitialized.cpp:2411: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(m_map.at(index)->data + offset, src, size);
data/oclgrind-19.10/src/runtime/oclgrind.cpp:416: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 path[MAX_PATH];
data/oclgrind-19.10/src/runtime/oclgrind.cpp:422: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 exepath[PATH_MAX];
data/oclgrind-19.10/src/runtime/oclgrind.cpp:423: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 path[PATH_MAX];
data/oclgrind-19.10/src/runtime/oclgrind.cpp:539: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 buffer[1024];
data/oclgrind-19.10/src/runtime/runtime.cpp:364:7:  [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(param_value, result, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:797: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(param_value, str, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:799: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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:894:5:  [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(context->properties, properties, sz);
data/oclgrind-19.10/src/runtime/runtime.cpp:947:5:  [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(context->properties, properties, sz);
data/oclgrind-19.10/src/runtime/runtime.cpp:1052: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(param_value, properties, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:1054: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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:1211:7:  [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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:1905:7:  [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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2001:7:  [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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2202:7:  [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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2696: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(param_value, str, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2698: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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2769: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(param_value, str, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2771: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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2963:7:  [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(value.data, &(*(cl_sampler*)arg_value)->sampler, 4);
data/oclgrind-19.10/src/runtime/runtime.cpp:2967:7:  [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(value.data, arg_value, arg_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:2993: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(value.data, &mem->address, arg_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:3083: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(param_value, str, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:3085: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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:3165:7:  [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(param_value, str_data.c_str(), result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:3167:7:  [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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:3242:7:  [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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:3389:7:  [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(param_value, &result_data, result_size);
data/oclgrind-19.10/src/runtime/runtime.cpp:3779:3:  [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(cmd->region, region, 3*sizeof(size_t));
data/oclgrind-19.10/src/runtime/runtime.cpp:3938:3:  [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(cmd->region, region, 3*sizeof(size_t));
data/oclgrind-19.10/src/runtime/runtime.cpp:4122:3:  [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(cmd->region, region, 3*sizeof(size_t));
data/oclgrind-19.10/src/runtime/runtime.cpp:5038:3:  [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(&cmd->globalSize, global_work_size, work_dim*sizeof(size_t));
data/oclgrind-19.10/src/runtime/runtime.cpp:5041:5:  [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(&cmd->globalOffset, global_work_offset, work_dim*sizeof(size_t));
data/oclgrind-19.10/src/runtime/runtime.cpp:5045:5:  [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(&cmd->localSize, local_work_size, work_dim*sizeof(size_t));
data/oclgrind-19.10/src/runtime/runtime.cpp:5135:5:  [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((void*)args_mem_loc[i], &addr, sizeof(void*));
data/oclgrind-19.10/tests/apps/vecadd/vecadd.c:32:9:  [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).
    N = atoi(argv[1]);
data/oclgrind-19.10/tests/apps/vecadd/vecadd.c:38:14:  [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).
    global = atoi(argv[2]);
data/oclgrind-19.10/tests/common/common.c:18: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 name[256];
data/oclgrind-19.10/tests/runtime/map_buffer.c:274:9:  [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).
    N = atoi(argv[1]);
data/oclgrind-19.10/src/core/Program.cpp:304:31:  [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).
  char *tmpOptions = new char[strlen(mainOptions) + strlen(extraOptions) + 2];
data/oclgrind-19.10/src/core/Program.cpp:304:53:  [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).
  char *tmpOptions = new char[strlen(mainOptions) + strlen(extraOptions) + 2];
data/oclgrind-19.10/src/core/Program.cpp:308:10:  [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).
  while (strlen(opt) > 0)
data/oclgrind-19.10/src/core/Program.cpp:314:10:  [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 (!strlen(opt))
data/oclgrind-19.10/src/core/Program.cpp:396:38:  [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).
          pchdir = new char[length + strlen(pch_relative) + 1];
data/oclgrind-19.10/src/core/Program.cpp:397:11:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          strncpy(pchdir, libpath, length);
data/oclgrind-19.10/src/core/Program.cpp:406:22:  [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).
      pch = new char[strlen(pchdir) + 24];
data/oclgrind-19.10/src/core/common.cpp:299:9:  [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 (strlen(next) || result == ULONG_MAX || (!allowZero && !result))
data/oclgrind-19.10/src/kernel/Simulation.cpp:163:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    progFile.read(magic, 2);
data/oclgrind-19.10/src/kernel/Simulation.cpp:184:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      progFile.read(data, sz+1);
data/oclgrind-19.10/src/plugins/MemCheck.cpp:224:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void MemCheck::logInvalidAccess(bool read, unsigned addrSpace,
data/oclgrind-19.10/src/plugins/MemCheck.cpp:228:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  msg << "Invalid " << (read ? "read" : "write")
data/oclgrind-19.10/src/plugins/MemCheck.h:55:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    void logInvalidAccess(bool read, unsigned addrSpace,
data/oclgrind-19.10/src/runtime/runtime.cpp:348: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).
  size_t result_size = strlen(result) + 1;
data/oclgrind-19.10/src/runtime/runtime.cpp:2240:60:  [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).
    size_t length = (lengths && lengths[i]) ? lengths[i] : strlen(strings[i]);
data/oclgrind-19.10/src/runtime/runtime.cpp:2649:19:  [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).
    result_size = strlen(str) + 1;
data/oclgrind-19.10/src/runtime/runtime.cpp:2675:19:  [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).
    result_size = strlen(str) + 1;
data/oclgrind-19.10/src/runtime/runtime.cpp:2740:19:  [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).
    result_size = strlen(str) + 1;
data/oclgrind-19.10/src/runtime/runtime.cpp:2744:19:  [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).
    result_size = strlen(str) + 1;

ANALYSIS SUMMARY:

Hits = 173
Lines analyzed = 31318 in approximately 0.66 seconds (47422 lines/second)
Physical Source Lines of Code (SLOC) = 25636
Hits@level = [0]  22 [1]  19 [2] 102 [3]  20 [4]  31 [5]   1
Hits@level+ = [0+] 195 [1+] 173 [2+] 154 [3+]  52 [4+]  32 [5+]   1
Hits/KSLOC@level+ = [0+] 7.60649 [1+] 6.74832 [2+] 6.00718 [3+] 2.0284 [4+] 1.24824 [5+] 0.0390076
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.