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/forge-1.0.1/CMakeModules/glsl2cpp.cpp
Examining data/forge-1.0.1/examples/cpu/bubblechart.cpp
Examining data/forge-1.0.1/examples/cpu/field.cpp
Examining data/forge-1.0.1/examples/cpu/fractal.cpp
Examining data/forge-1.0.1/examples/cpu/histogram.cpp
Examining data/forge-1.0.1/examples/cpu/plot3.cpp
Examining data/forge-1.0.1/examples/cpu/plotting.cpp
Examining data/forge-1.0.1/examples/cpu/stream.cpp
Examining data/forge-1.0.1/examples/cpu/surface.cpp
Examining data/forge-1.0.1/examples/opencl/bubblechart.cpp
Examining data/forge-1.0.1/examples/opencl/cl_helpers.h
Examining data/forge-1.0.1/examples/opencl/field.cpp
Examining data/forge-1.0.1/examples/opencl/fractal.cpp
Examining data/forge-1.0.1/examples/opencl/histogram.cpp
Examining data/forge-1.0.1/examples/opencl/plot3.cpp
Examining data/forge-1.0.1/examples/opencl/plotting.cpp
Examining data/forge-1.0.1/examples/opencl/stream.cpp
Examining data/forge-1.0.1/examples/opencl/surface.cpp
Examining data/forge-1.0.1/include/ComputeCopy.h
Examining data/forge-1.0.1/include/fg/chart.h
Examining data/forge-1.0.1/include/fg/defines.h
Examining data/forge-1.0.1/include/fg/exception.h
Examining data/forge-1.0.1/include/fg/font.h
Examining data/forge-1.0.1/include/fg/histogram.h
Examining data/forge-1.0.1/include/fg/image.h
Examining data/forge-1.0.1/include/fg/plot.h
Examining data/forge-1.0.1/include/fg/surface.h
Examining data/forge-1.0.1/include/fg/util.h
Examining data/forge-1.0.1/include/fg/vector_field.h
Examining data/forge-1.0.1/include/fg/window.h
Examining data/forge-1.0.1/include/forge.h
Examining data/forge-1.0.1/src/api/c/chart.cpp
Examining data/forge-1.0.1/src/api/c/exception.cpp
Examining data/forge-1.0.1/src/api/c/font.cpp
Examining data/forge-1.0.1/src/api/c/histogram.cpp
Examining data/forge-1.0.1/src/api/c/image.cpp
Examining data/forge-1.0.1/src/api/c/plot.cpp
Examining data/forge-1.0.1/src/api/c/surface.cpp
Examining data/forge-1.0.1/src/api/c/vector_field.cpp
Examining data/forge-1.0.1/src/api/c/window.cpp
Examining data/forge-1.0.1/src/api/cpp/chart.cpp
Examining data/forge-1.0.1/src/api/cpp/error.hpp
Examining data/forge-1.0.1/src/api/cpp/exception.cpp
Examining data/forge-1.0.1/src/api/cpp/font.cpp
Examining data/forge-1.0.1/src/api/cpp/histogram.cpp
Examining data/forge-1.0.1/src/api/cpp/image.cpp
Examining data/forge-1.0.1/src/api/cpp/plot.cpp
Examining data/forge-1.0.1/src/api/cpp/surface.cpp
Examining data/forge-1.0.1/src/api/cpp/vector_field.cpp
Examining data/forge-1.0.1/src/api/cpp/window.cpp
Examining data/forge-1.0.1/src/backend/chart.hpp
Examining data/forge-1.0.1/src/backend/chart_common.hpp
Examining data/forge-1.0.1/src/backend/chart_renderables.hpp
Examining data/forge-1.0.1/src/backend/cmap.hpp
Examining data/forge-1.0.1/src/backend/defines.hpp
Examining data/forge-1.0.1/src/backend/err_common.cpp
Examining data/forge-1.0.1/src/backend/err_common.hpp
Examining data/forge-1.0.1/src/backend/font.hpp
Examining data/forge-1.0.1/src/backend/handle.cpp
Examining data/forge-1.0.1/src/backend/handle.hpp
Examining data/forge-1.0.1/src/backend/image.hpp
Examining data/forge-1.0.1/src/backend/opengl/backend.hpp
Examining data/forge-1.0.1/src/backend/opengl/chart_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/chart_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/colormap_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/colormap_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/common.cpp
Examining data/forge-1.0.1/src/backend/opengl/err_opengl.cpp
Examining data/forge-1.0.1/src/backend/opengl/err_opengl.hpp
Examining data/forge-1.0.1/src/backend/opengl/font_atlas_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/font_atlas_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/font_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/gl_native_handles.cpp
Examining data/forge-1.0.1/src/backend/opengl/gl_native_handles.hpp
Examining data/forge-1.0.1/src/backend/opengl/glfw/window.hpp
Examining data/forge-1.0.1/src/backend/opengl/glfw/window.cpp
Examining data/forge-1.0.1/src/backend/opengl/histogram_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/histogram_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/image_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/image_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/plot_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/plot_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/sdl/window.hpp
Examining data/forge-1.0.1/src/backend/opengl/sdl/window.cpp
Examining data/forge-1.0.1/src/backend/opengl/surface_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/surface_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/util.cpp
Examining data/forge-1.0.1/src/backend/opengl/vector_field_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/vector_field_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/window_impl.cpp
Examining data/forge-1.0.1/src/backend/opengl/window_impl.hpp
Examining data/forge-1.0.1/src/backend/opengl/common.hpp
Examining data/forge-1.0.1/src/backend/opengl/font_impl.cpp
Examining data/forge-1.0.1/src/backend/util.cpp
Examining data/forge-1.0.1/src/backend/util.hpp
Examining data/forge-1.0.1/src/backend/window.hpp

FINAL RESULTS:

data/forge-1.0.1/src/backend/defines.hpp:32:17:  [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 sprintf_s
data/forge-1.0.1/src/backend/opengl/common.cpp:279:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(label.get(), pFormat.c_str(), pVal);
data/forge-1.0.1/examples/cpu/histogram.cpp:142:10:  [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.
    std::srand(std::time(0));
data/forge-1.0.1/examples/opencl/bubblechart.cpp:95:10:  [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.
    std::srand(std::time(0));
data/forge-1.0.1/examples/opencl/histogram.cpp:168:10:  [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.
    std::srand(std::time(0));
data/forge-1.0.1/src/backend/util.cpp:34:18:  [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 * str = getenv(key.c_str());
data/forge-1.0.1/include/fg/exception.h:25: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        mMessage[1024];
data/forge-1.0.1/src/backend/opengl/common.cpp:227:4:  [2] (buffer) TCHAR:
  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.
   TCHAR szDir[MAX_PATH];
data/forge-1.0.1/src/backend/opengl/font_atlas_impl.cpp:238:18:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            std::memcpy(mData.data() + ((pY+i)*mWidth + pX) * charsize * depth,
data/forge-1.0.1/src/backend/opengl/font_impl.cpp:377: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[512];
data/forge-1.0.1/src/api/cpp/exception.cpp:27:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(dest, src, len);
data/forge-1.0.1/src/backend/opengl/font_impl.cpp:444:29:  [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 (size_t i=0; i<std::strlen(pText); ++i)

ANALYSIS SUMMARY:

Hits = 12
Lines analyzed = 19201 in approximately 0.76 seconds (25375 lines/second)
Physical Source Lines of Code (SLOC) = 12523
Hits@level = [0]   8 [1]   2 [2]   4 [3]   4 [4]   2 [5]   0
Hits@level+ = [0+]  20 [1+]  12 [2+]  10 [3+]   6 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 1.59706 [1+] 0.958237 [2+] 0.798531 [3+] 0.479118 [4+] 0.159706 [5+]   0
Dot directories skipped = 2 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.