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/fityk-1.3.1/cli/gnuplot.cpp
Examining data/fityk-1.3.1/cli/gnuplot.h
Examining data/fityk-1.3.1/cli/main.cpp
Examining data/fityk-1.3.1/doxygen/docs.h
Examining data/fityk-1.3.1/fityk/CMPfit.cpp
Examining data/fityk-1.3.1/fityk/CMPfit.h
Examining data/fityk-1.3.1/fityk/GAfit.cpp
Examining data/fityk-1.3.1/fityk/GAfit.h
Examining data/fityk-1.3.1/fityk/LMfit.cpp
Examining data/fityk-1.3.1/fityk/LMfit.h
Examining data/fityk-1.3.1/fityk/NLfit.cpp
Examining data/fityk-1.3.1/fityk/NLfit.h
Examining data/fityk-1.3.1/fityk/NMfit.cpp
Examining data/fityk-1.3.1/fityk/NMfit.h
Examining data/fityk-1.3.1/fityk/ast.cpp
Examining data/fityk-1.3.1/fityk/ast.h
Examining data/fityk-1.3.1/fityk/bfunc.cpp
Examining data/fityk-1.3.1/fityk/bfunc.h
Examining data/fityk-1.3.1/fityk/cmpfit/mpfit.c
Examining data/fityk-1.3.1/fityk/cmpfit/mpfit.h
Examining data/fityk-1.3.1/fityk/common.cpp
Examining data/fityk-1.3.1/fityk/common.h
Examining data/fityk-1.3.1/fityk/cparser.cpp
Examining data/fityk-1.3.1/fityk/cparser.h
Examining data/fityk-1.3.1/fityk/data.cpp
Examining data/fityk-1.3.1/fityk/data.h
Examining data/fityk-1.3.1/fityk/eparser.cpp
Examining data/fityk-1.3.1/fityk/eparser.h
Examining data/fityk-1.3.1/fityk/f_fcjasym.cpp
Examining data/fityk-1.3.1/fityk/f_fcjasym.h
Examining data/fityk-1.3.1/fityk/fit.cpp
Examining data/fityk-1.3.1/fityk/fit.h
Examining data/fityk-1.3.1/fityk/fityk.cpp
Examining data/fityk-1.3.1/fityk/fityk.h
Examining data/fityk-1.3.1/fityk/func.cpp
Examining data/fityk-1.3.1/fityk/func.h
Examining data/fityk-1.3.1/fityk/guess.cpp
Examining data/fityk-1.3.1/fityk/guess.h
Examining data/fityk-1.3.1/fityk/info.cpp
Examining data/fityk-1.3.1/fityk/info.h
Examining data/fityk-1.3.1/fityk/lexer.cpp
Examining data/fityk-1.3.1/fityk/lexer.h
Examining data/fityk-1.3.1/fityk/logic.cpp
Examining data/fityk-1.3.1/fityk/logic.h
Examining data/fityk-1.3.1/fityk/luabridge.cpp
Examining data/fityk-1.3.1/fityk/luabridge.h
Examining data/fityk-1.3.1/fityk/mgr.cpp
Examining data/fityk-1.3.1/fityk/mgr.h
Examining data/fityk-1.3.1/fityk/model.cpp
Examining data/fityk-1.3.1/fityk/model.h
Examining data/fityk-1.3.1/fityk/numfuncs.cpp
Examining data/fityk-1.3.1/fityk/numfuncs.h
Examining data/fityk-1.3.1/fityk/root/background.cpp
Examining data/fityk-1.3.1/fityk/root/background.hpp
Examining data/fityk-1.3.1/fityk/runner.cpp
Examining data/fityk-1.3.1/fityk/runner.h
Examining data/fityk-1.3.1/fityk/settings.cpp
Examining data/fityk-1.3.1/fityk/settings.h
Examining data/fityk-1.3.1/fityk/tplate.cpp
Examining data/fityk-1.3.1/fityk/tplate.h
Examining data/fityk-1.3.1/fityk/transform.cpp
Examining data/fityk-1.3.1/fityk/transform.h
Examining data/fityk-1.3.1/fityk/udf.cpp
Examining data/fityk-1.3.1/fityk/udf.h
Examining data/fityk-1.3.1/fityk/ui.cpp
Examining data/fityk-1.3.1/fityk/ui.h
Examining data/fityk-1.3.1/fityk/ui_api.cpp
Examining data/fityk-1.3.1/fityk/ui_api.h
Examining data/fityk-1.3.1/fityk/var.cpp
Examining data/fityk-1.3.1/fityk/var.h
Examining data/fityk-1.3.1/fityk/view.cpp
Examining data/fityk-1.3.1/fityk/view.h
Examining data/fityk-1.3.1/fityk/vm.cpp
Examining data/fityk-1.3.1/fityk/vm.h
Examining data/fityk-1.3.1/fityk/voigt.cpp
Examining data/fityk-1.3.1/fityk/voigt.h
Examining data/fityk-1.3.1/samples/hello.c
Examining data/fityk-1.3.1/samples/hello.cc
Examining data/fityk-1.3.1/tests/catch.cpp
Examining data/fityk-1.3.1/tests/gradient.cpp
Examining data/fityk-1.3.1/tests/guess.cpp
Examining data/fityk-1.3.1/tests/lua.cpp
Examining data/fityk-1.3.1/tests/mpfit_deriv.cpp
Examining data/fityk-1.3.1/tests/num.cpp
Examining data/fityk-1.3.1/tests/psvoigt.cpp
Examining data/fityk-1.3.1/wxgui/about.cpp
Examining data/fityk-1.3.1/wxgui/about.h
Examining data/fityk-1.3.1/wxgui/aplot.cpp
Examining data/fityk-1.3.1/wxgui/aplot.h
Examining data/fityk-1.3.1/wxgui/app.h
Examining data/fityk-1.3.1/wxgui/atomtables.c
Examining data/fityk-1.3.1/wxgui/atomtables.h
Examining data/fityk-1.3.1/wxgui/bgm.cpp
Examining data/fityk-1.3.1/wxgui/bgm.h
Examining data/fityk-1.3.1/wxgui/ceria.cpp
Examining data/fityk-1.3.1/wxgui/ceria.h
Examining data/fityk-1.3.1/wxgui/cmn.cpp
Examining data/fityk-1.3.1/wxgui/cmn.h
Examining data/fityk-1.3.1/wxgui/dataedit.cpp
Examining data/fityk-1.3.1/wxgui/dataedit.h
Examining data/fityk-1.3.1/wxgui/datatable.cpp
Examining data/fityk-1.3.1/wxgui/datatable.h
Examining data/fityk-1.3.1/wxgui/defmgr.cpp
Examining data/fityk-1.3.1/wxgui/defmgr.h
Examining data/fityk-1.3.1/wxgui/dload.cpp
Examining data/fityk-1.3.1/wxgui/dload.h
Examining data/fityk-1.3.1/wxgui/drag.cpp
Examining data/fityk-1.3.1/wxgui/drag.h
Examining data/fityk-1.3.1/wxgui/editor.cpp
Examining data/fityk-1.3.1/wxgui/editor.h
Examining data/fityk-1.3.1/wxgui/exportd.cpp
Examining data/fityk-1.3.1/wxgui/exportd.h
Examining data/fityk-1.3.1/wxgui/fitinfo.cpp
Examining data/fityk-1.3.1/wxgui/fitinfo.h
Examining data/fityk-1.3.1/wxgui/fitrun.cpp
Examining data/fityk-1.3.1/wxgui/fitrun.h
Examining data/fityk-1.3.1/wxgui/frame.cpp
Examining data/fityk-1.3.1/wxgui/frame.h
Examining data/fityk-1.3.1/wxgui/gradient.cpp
Examining data/fityk-1.3.1/wxgui/gradient.h
Examining data/fityk-1.3.1/wxgui/history.cpp
Examining data/fityk-1.3.1/wxgui/history.h
Examining data/fityk-1.3.1/wxgui/img/bin2c.c
Examining data/fityk-1.3.1/wxgui/img/book16.h
Examining data/fityk-1.3.1/wxgui/img/correction.h
Examining data/fityk-1.3.1/wxgui/img/editor16.h
Examining data/fityk-1.3.1/wxgui/img/eq_fwhm.h
Examining data/fityk-1.3.1/wxgui/img/eq_shape.h
Examining data/fityk-1.3.1/wxgui/img/export16.h
Examining data/fityk-1.3.1/wxgui/img/fileopen16.h
Examining data/fityk-1.3.1/wxgui/img/filereload16.h
Examining data/fityk-1.3.1/wxgui/img/filesaveas16.h
Examining data/fityk-1.3.1/wxgui/img/fityk96.h
Examining data/fityk-1.3.1/wxgui/img/function16.h
Examining data/fityk-1.3.1/wxgui/img/image16.h
Examining data/fityk-1.3.1/wxgui/img/info16.h
Examining data/fityk-1.3.1/wxgui/img/info32.h
Examining data/fityk-1.3.1/wxgui/img/mouse16.h
Examining data/fityk-1.3.1/wxgui/img/ok24.h
Examining data/fityk-1.3.1/wxgui/img/peak32.h
Examining data/fityk-1.3.1/wxgui/img/preferences16.h
Examining data/fityk-1.3.1/wxgui/img/radiation32.h
Examining data/fityk-1.3.1/wxgui/img/recordmacro16.h
Examining data/fityk-1.3.1/wxgui/img/redo16.h
Examining data/fityk-1.3.1/wxgui/img/reload16.h
Examining data/fityk-1.3.1/wxgui/img/revert16.h
Examining data/fityk-1.3.1/wxgui/img/rubik32.h
Examining data/fityk-1.3.1/wxgui/img/run16.h
Examining data/fityk-1.3.1/wxgui/img/run32.h
Examining data/fityk-1.3.1/wxgui/img/runmacro16.h
Examining data/fityk-1.3.1/wxgui/img/sbprefs.h
Examining data/fityk-1.3.1/wxgui/img/sizes32.h
Examining data/fityk-1.3.1/wxgui/img/stopmacro16.h
Examining data/fityk-1.3.1/wxgui/img/undo16.h
Examining data/fityk-1.3.1/wxgui/img/web16.h
Examining data/fityk-1.3.1/wxgui/img/zoom-fit16.h
Examining data/fityk-1.3.1/wxgui/inputline.cpp
Examining data/fityk-1.3.1/wxgui/inputline.h
Examining data/fityk-1.3.1/wxgui/listptxt.cpp
Examining data/fityk-1.3.1/wxgui/listptxt.h
Examining data/fityk-1.3.1/wxgui/merge.cpp
Examining data/fityk-1.3.1/wxgui/merge.h
Examining data/fityk-1.3.1/wxgui/modelinfo.cpp
Examining data/fityk-1.3.1/wxgui/modelinfo.h
Examining data/fityk-1.3.1/wxgui/mplot.cpp
Examining data/fityk-1.3.1/wxgui/mplot.h
Examining data/fityk-1.3.1/wxgui/parpan.cpp
Examining data/fityk-1.3.1/wxgui/parpan.h
Examining data/fityk-1.3.1/wxgui/plot.cpp
Examining data/fityk-1.3.1/wxgui/plot.h
Examining data/fityk-1.3.1/wxgui/plotpane.cpp
Examining data/fityk-1.3.1/wxgui/plotpane.h
Examining data/fityk-1.3.1/wxgui/powdifpat.cpp
Examining data/fityk-1.3.1/wxgui/powdifpat.h
Examining data/fityk-1.3.1/wxgui/print.cpp
Examining data/fityk-1.3.1/wxgui/print.h
Examining data/fityk-1.3.1/wxgui/recent.cpp
Examining data/fityk-1.3.1/wxgui/recent.h
Examining data/fityk-1.3.1/wxgui/sample_inputline.cpp
Examining data/fityk-1.3.1/wxgui/setdlg.cpp
Examining data/fityk-1.3.1/wxgui/setdlg.h
Examining data/fityk-1.3.1/wxgui/sgchooser.cpp
Examining data/fityk-1.3.1/wxgui/sgchooser.h
Examining data/fityk-1.3.1/wxgui/sgtables.c
Examining data/fityk-1.3.1/wxgui/sgtables.h
Examining data/fityk-1.3.1/wxgui/sidebar.cpp
Examining data/fityk-1.3.1/wxgui/sidebar.h
Examining data/fityk-1.3.1/wxgui/statbar.cpp
Examining data/fityk-1.3.1/wxgui/statbar.h
Examining data/fityk-1.3.1/wxgui/textpane.cpp
Examining data/fityk-1.3.1/wxgui/textpane.h
Examining data/fityk-1.3.1/wxgui/uplot.cpp
Examining data/fityk-1.3.1/wxgui/uplot.h
Examining data/fityk-1.3.1/wxgui/xybrowser.cpp
Examining data/fityk-1.3.1/wxgui/xybrowser.h
Examining data/fityk-1.3.1/wxgui/app.cpp

FINAL RESULTS:

data/fityk-1.3.1/cli/gnuplot.cpp:64:9:  [4] (shell) execlp:
  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.
        execlp(GNUPLOT_PATH, GNUPLOT_PATH, /*"-",*/ NULL);
data/fityk-1.3.1/cli/main.cpp:19:11:  [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.
#  define access _access
data/fityk-1.3.1/cli/main.cpp:94:13:  [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(dir.c_str(), X_OK) != 0)
data/fityk-1.3.1/cli/main.cpp:318:13:  [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(init_file.c_str(), R_OK) == 0) {
data/fityk-1.3.1/fityk/cmpfit/mpfit.c:937:5:  [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(result->version, MPFIT_VERSION);
data/fityk-1.3.1/fityk/common.h:29: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 sprintf_s
data/fityk-1.3.1/fityk/common.h:53:5:  [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.
    snprintf(buffer, N, fmt, t);
data/fityk-1.3.1/fityk/fityk.cpp:512:5:  [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(ret, info.c_str());
data/fityk-1.3.1/fityk/runner.cpp:143:13:  [4] (shell) popen:
  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.
        f = popen(str.c_str(), "r");
data/fityk-1.3.1/fityk/runner.cpp:790:13:  [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.
            system(c.args[0].str);
data/fityk-1.3.1/wxgui/app.cpp:460:9:  [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.
        system(("open -n " + res.substr(0, res.size()-19)).c_str());
data/fityk-1.3.1/wxgui/datatable.cpp:143:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(buffer, "A[%d]=%s", row, (value ? "true" : "false"));
data/fityk-1.3.1/wxgui/img/bin2c.c:63:8:  [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(buf, cp);
data/fityk-1.3.1/wxgui/powdifpat.cpp:735:50:  [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.
                                        pchar2wx(system).c_str(),
data/fityk-1.3.1/wxgui/xybrowser.cpp:22: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 sprintf_s
data/fityk-1.3.1/wxgui/xybrowser.cpp:28:5:  [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.
    snprintf(buffer, N, fmt, t);
data/fityk-1.3.1/cli/main.cpp:83:22:  [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 *home_dir = getenv("HOME");
data/fityk-1.3.1/cli/main.cpp:184:21:  [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 *hfs = getenv ("HISTFILESIZE");
data/fityk-1.3.1/fityk/settings.cpp:320:5:  [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(seed);
data/fityk-1.3.1/cli/main.cpp:82: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 t[200];
data/fityk-1.3.1/cli/main.cpp:186:30:  [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).
            hist_file_size = atoi (hfs);
data/fityk-1.3.1/cli/main.cpp:221: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 line_buffer[1024];
data/fityk-1.3.1/fityk/cmpfit/mpfit.h:117: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 version[20];    /* MPFIT version string */
data/fityk-1.3.1/fityk/common.h:52: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 buffer[N];
data/fityk-1.3.1/fityk/info.cpp:648:19:  [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 *f = fopen(filename.c_str(), mode);
data/fityk-1.3.1/fityk/logic.cpp:264:15:  [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 *f = fopen(filename.c_str(), "rb");
data/fityk-1.3.1/fityk/logic.cpp:275: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 buffer[32];
data/fityk-1.3.1/fityk/mgr.cpp:579:20:  [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).
        appendix = atoi(v->name.c_str()+vs-2);
data/fityk-1.3.1/fityk/settings.cpp:218:23:  [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* f = fopen(v.c_str(), "a");
data/fityk-1.3.1/fityk/ui.cpp:159:19:  [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* f = fopen(ctx_->get_settings()->logfile.c_str(), "a");
data/fityk-1.3.1/fityk/ui.cpp:201:19:  [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* f = fopen(ctx_->get_settings()->logfile.c_str(), "a");
data/fityk-1.3.1/fityk/ui.cpp:225:18:  [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).
    virtual bool open(const char* fn) = 0;
data/fityk-1.3.1/fityk/ui.cpp:236:18:  [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).
    virtual bool open(const char* fn) { f_=fopen(fn, "r"); return f_!=NULL; }
data/fityk-1.3.1/fityk/ui.cpp:236:44:  [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).
    virtual bool open(const char* fn) { f_=fopen(fn, "r"); return f_!=NULL; }
data/fityk-1.3.1/fityk/ui.cpp:247:18:  [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).
    virtual bool open(const char* fn) { f_=gzopen(fn, "rb"); return f_!=NULL; }
data/fityk-1.3.1/fityk/ui.cpp:263:18:  [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).
    if (!opener->open(filename.c_str())) {
data/fityk-1.3.1/fityk/ui.cpp:336:27:  [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* f = fopen(ctx_->get_settings()->logfile.c_str(), "a");
data/fityk-1.3.1/fityk/ui_api.cpp:70: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 s[100];
data/fityk-1.3.1/fityk/view.cpp:20: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 buffer[128];
data/fityk-1.3.1/fityk/view.cpp:21:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buffer, "[%.12g:%.12g] [%.12g:%.12g]",
data/fityk-1.3.1/wxgui/atomtables.c:147: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[3] = { 0, 0, 0 };
data/fityk-1.3.1/wxgui/atomtables.c:883: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[16];
data/fityk-1.3.1/wxgui/atomtables.c:1006: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[3] = { 0, 0, 0 };
data/fityk-1.3.1/wxgui/ceria.cpp:131: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(a.symbol, s, symbol_len);
data/fityk-1.3.1/wxgui/ceria.cpp:168: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(b.symbol, a.symbol, 8);
data/fityk-1.3.1/wxgui/ceria.cpp:287: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 s[32];
data/fityk-1.3.1/wxgui/ceria.cpp:329: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 qualif[5];
data/fityk-1.3.1/wxgui/ceria.cpp:727: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 s[20];
data/fityk-1.3.1/wxgui/ceria.cpp:806:19:  [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 *f = fopen(filename.c_str(), "w");
data/fityk-1.3.1/wxgui/ceria.h:120: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 symbol[8];
data/fityk-1.3.1/wxgui/datatable.cpp:103:15:  [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[128];
data/fityk-1.3.1/wxgui/datatable.cpp:104:15:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
              sprintf(buffer,
data/fityk-1.3.1/wxgui/datatable.cpp:121: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 buffer[32];
data/fityk-1.3.1/wxgui/datatable.cpp:128:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(buffer+1, "[%d]=%.12g", row, value);
data/fityk-1.3.1/wxgui/datatable.cpp:142:9:  [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[32];
data/fityk-1.3.1/wxgui/img/bin2c.c:43:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
       ifile = fopen(ifname, "rb");
data/fityk-1.3.1/wxgui/img/bin2c.c:48:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
       ofile = fopen(ofname, "wb");
data/fityk-1.3.1/wxgui/img/bin2c.c:53:8:  [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[PATH_MAX], *p;
data/fityk-1.3.1/wxgui/inputline.cpp:63: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 line[512];
data/fityk-1.3.1/wxgui/sgtables.h:29: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 txt[8];
data/fityk-1.3.1/wxgui/sgtables.h:38: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 qualif[5]; /* e.g. "-cba" or "b1" */
data/fityk-1.3.1/wxgui/sgtables.h:39: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 HM[11]; /* H-M symbol; nul-terminated string */
data/fityk-1.3.1/wxgui/sgtables.h:40: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 Hall[16]; /* Hall symbol; nul-terminated string */
data/fityk-1.3.1/wxgui/textpane.cpp:61:9:  [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[10];
data/fityk-1.3.1/wxgui/xybrowser.cpp:27: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 buffer[N];
data/fityk-1.3.1/wxgui/xybrowser.cpp:357:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char buffer[65536];
data/fityk-1.3.1/cli/main.cpp:304: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).
        } else if (strlen(argv[i]) > 1 && argv[i][0] == '-') {
data/fityk-1.3.1/fityk/cmpfit/mpfit.c:31:32:  [1] (obsolete) ulimit:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2),
  setrlimit(2), and sysconf(3) instead.
	      int *qulimited, double *ulimit,
data/fityk-1.3.1/fityk/cmpfit/mpfit.c:994:32:  [1] (obsolete) ulimit:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2),
  setrlimit(2), and sysconf(3) instead.
	      int *qulimited, double *ulimit,
data/fityk-1.3.1/fityk/cmpfit/mpfit.c:1148:16:  [1] (obsolete) ulimit:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2),
  setrlimit(2), and sysconf(3) instead.
	 qulimited && ulimit && qulimited[j] && 
data/fityk-1.3.1/fityk/cmpfit/mpfit.c:1149:12:  [1] (obsolete) ulimit:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2),
  setrlimit(2), and sysconf(3) instead.
	 (temp > (ulimit[j]-h)))) {
data/fityk-1.3.1/fityk/cparser.cpp:105: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).
    int base_len = strlen(cmd_base);
data/fityk-1.3.1/fityk/cparser.cpp:110:35:  [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).
             (left_chars <= (int) strlen(cmd_suffix) &&
data/fityk-1.3.1/fityk/logic.cpp:274:27:  [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).
    const int magic_len = strlen(magic);
data/fityk-1.3.1/fityk/numfuncs.cpp:171: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).
        string blanks(strlen(mname) + 1, ' ');
data/fityk-1.3.1/fityk/ui.cpp:35:17:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((c = getc (stream)) != EOF) {
data/fityk-1.3.1/fityk/ui_api.cpp:23: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).
        if (strncmp(*p, text, strlen(text)) == 0)
data/fityk-1.3.1/fityk/ui_api.cpp:30:47:  [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 (strncmp((*i)->name.c_str(), text, strlen(text)) == 0)
data/fityk-1.3.1/fityk/ui_api.cpp:37: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).
    int hlen = strlen(head);
data/fityk-1.3.1/fityk/ui_api.cpp:211:36:  [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 (strncmp("guess", text, strlen(text)) == 0)
data/fityk-1.3.1/fityk/ui_api.cpp:218:54:  [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 (!strncmp((*i)->name.c_str(), text+1, strlen(text+1)))
data/fityk-1.3.1/fityk/ui_api.cpp:224: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).
            if (!strncmp ((*i)->name.c_str(), text, strlen(text)))
data/fityk-1.3.1/wxgui/atomtables.c:154: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(label) > 1 && isalpha(label[1]))
data/fityk-1.3.1/wxgui/atomtables.c:886:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buf, label, 14);
data/fityk-1.3.1/wxgui/atomtables.c:893: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).
    if (alpha_len != strlen(buf))
data/fityk-1.3.1/wxgui/atomtables.c:1013: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(label) > 1 && isalpha(label[1]))
data/fityk-1.3.1/wxgui/ceria.cpp:277:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(qualif, symbol, 4);
data/fityk-1.3.1/wxgui/ceria.cpp:728:13:  [1] (buffer) fscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
    int r = fscanf(f, "%4s %lf %lf %lf %lf %lf %lf",
data/fityk-1.3.1/wxgui/ceria.cpp:737:13:  [1] (buffer) fscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        r = fscanf(f, "%12s", s);
data/fityk-1.3.1/wxgui/ceria.cpp:750:22:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        for (int c = fgetc(f); c != '\n' && c != EOF; c = fgetc(f))
data/fityk-1.3.1/wxgui/ceria.cpp:750:59:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        for (int c = fgetc(f); c != '\n' && c != EOF; c = fgetc(f))
data/fityk-1.3.1/wxgui/ceria.cpp:760:18:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    for (int c = fgetc(f); c != '\n' && c != EOF; c = fgetc(f)) {
data/fityk-1.3.1/wxgui/ceria.cpp:760:55:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    for (int c = fgetc(f); c != '\n' && c != EOF; c = fgetc(f)) {
data/fityk-1.3.1/wxgui/ceria.cpp:762:17:  [1] (buffer) fscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
            r = fscanf(f, "%8s", s);
data/fityk-1.3.1/wxgui/img/bin2c.c:32:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
       int c = fgetc(f);
data/fityk-1.3.1/wxgui/sgtables.c:1118:12:  [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).
    assert(strlen(sgs->encoded_seitz) % 3 == 0);
data/fityk-1.3.1/wxgui/sgtables.c:1119:12:  [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).
    return strlen(sgs->encoded_seitz) / 3;
data/fityk-1.3.1/wxgui/sgtables.c:1137: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).
    assert(n < (int) strlen(sgs->encoded_seitz) / 3);

ANALYSIS SUMMARY:

Hits = 98
Lines analyzed = 49648 in approximately 1.48 seconds (33523 lines/second)
Physical Source Lines of Code (SLOC) = 40423
Hits@level = [0]  67 [1]  32 [2]  47 [3]   3 [4]  16 [5]   0
Hits@level+ = [0+] 165 [1+]  98 [2+]  66 [3+]  19 [4+]  16 [5+]   0
Hits/KSLOC@level+ = [0+] 4.08183 [1+] 2.42436 [2+] 1.63273 [3+] 0.470029 [4+] 0.395814 [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.