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/aghermann-1.1.2/src/project_strings.h
Examining data/aghermann-1.1.2/src/common/libcommon.cc
Examining data/aghermann-1.1.2/src/common/log-facility.cc
Examining data/aghermann-1.1.2/src/common/subject_id.cc
Examining data/aghermann-1.1.2/src/libsigproc/exstrom.cc
Examining data/aghermann-1.1.2/src/libsigproc/ext-filters.cc
Examining data/aghermann-1.1.2/src/libsigproc/sigproc.cc
Examining data/aghermann-1.1.2/src/libsigproc/winfun.cc
Examining data/aghermann-1.1.2/src/libsigfile/channel.cc
Examining data/aghermann-1.1.2/src/libsigfile/source-base.cc
Examining data/aghermann-1.1.2/src/libsigfile/typed-source.cc
Examining data/aghermann-1.1.2/src/libsigfile/edf.cc
Examining data/aghermann-1.1.2/src/libsigfile/edf-io.cc
Examining data/aghermann-1.1.2/src/libsigfile/tsv.cc
Examining data/aghermann-1.1.2/src/libsigfile/page.cc
Examining data/aghermann-1.1.2/src/libmetrics/page-metrics-base.cc
Examining data/aghermann-1.1.2/src/libmetrics/psd.cc
Examining data/aghermann-1.1.2/src/libmetrics/swu.cc
Examining data/aghermann-1.1.2/src/libmetrics/mc.cc
Examining data/aghermann-1.1.2/src/libmetrics/mc-artifacts.cc
Examining data/aghermann-1.1.2/src/aghermann/artifact-detection/3in1.cc
Examining data/aghermann-1.1.2/src/aghermann/expdesign/dirlevel.cc
Examining data/aghermann-1.1.2/src/aghermann/expdesign/expdesign.cc
Examining data/aghermann-1.1.2/src/aghermann/expdesign/loadsave.cc
Examining data/aghermann-1.1.2/src/aghermann/expdesign/recording.cc
Examining data/aghermann-1.1.2/src/aghermann/expdesign/subject.cc
Examining data/aghermann-1.1.2/src/aghermann/expdesign/tree-scanner.cc
Examining data/aghermann-1.1.2/src/aghermann/model/achermann-tunable.cc
Examining data/aghermann-1.1.2/src/aghermann/model/achermann.cc
Examining data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc
Examining data/aghermann-1.1.2/src/aghermann/model/ultradian-cycle.cc
Examining data/aghermann-1.1.2/src/aghermann/model/borbely.cc
Examining data/aghermann-1.1.2/src/aghermann/patterns/patterns.cc
Examining data/aghermann-1.1.2/src/aghermann/rk1968/rk1968-profiles.cc
Examining data/aghermann-1.1.2/src/aghermann/rk1968/rk1968.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mf/construct.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mf/mf.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mf/mf_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/admit-one.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/admit-one_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/construct.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/loadsave.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/mainmenu_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/measurements.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/measurements_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/populate.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/settings_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/simulations.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/simulations_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/splash.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/mw.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/mw/mw_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/artifacts.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/artifacts-profiles_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/artifacts_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/filters.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/filters-construct.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/filters_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/patterns.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/patterns-draw.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/patterns-profiles.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/patterns_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/patterns-profiles_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/phasediff.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/phasediff-construct.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/phasediff_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/rk1968.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/rk1968-profiles.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/rk1968-profiles_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/d/rk1968_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/channel.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/construct.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/controls_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/hypnogram.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/hypnogram_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/ica.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/ica_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/mainmenu_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/montage-overlays.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/montage.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/montage_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/montage-menus_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/sf.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sf/sf_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sm/sm-construct.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sm/sm.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/sm/sm_cb.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/globals.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/misc.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/ui++.cc
Examining data/aghermann-1.1.2/src/aghermann/ui/ui.cc
Examining data/aghermann-1.1.2/src/aghermann/main.cc
Examining data/aghermann-1.1.2/src/aghermann/globals.cc
Examining data/aghermann-1.1.2/src/tools/agh-profile-gen.cc
Examining data/aghermann-1.1.2/src/tools/edfcat.cc
Examining data/aghermann-1.1.2/src/tools/edfhed.cc
Examining data/aghermann-1.1.2/src/tools/edfhed-gtk.cc

FINAL RESULTS:

data/aghermann-1.1.2/src/aghermann/expdesign/dirlevel.cc:47:28:  [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.
        case TExpDirLevel::system:      return "<S>";
data/aghermann-1.1.2/src/aghermann/expdesign/dirlevel.cc:61:28:  [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.
        case TExpDirLevel::system:
data/aghermann-1.1.2/src/aghermann/expdesign/dirlevel.cc:96:28:  [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.
        case TExpDirLevel::system:
data/aghermann-1.1.2/src/aghermann/expdesign/dirlevel.cc:126:82:  [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.
        if ( saved || level == TExpDirLevel::transient || level == TExpDirLevel::system )
data/aghermann-1.1.2/src/aghermann/expdesign/expdesign.cc:256:28:  [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.
        case TExpDirLevel::system:
data/aghermann-1.1.2/src/aghermann/expdesign/expdesign.cc:641:16:  [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.
        return system(
data/aghermann-1.1.2/src/aghermann/patterns/patterns.cc:50:92:  [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.
        if ( saved || level == agh::TExpDirLevel::transient || level == agh::TExpDirLevel::system )
data/aghermann-1.1.2/src/aghermann/rk1968/rk1968.cc:88:82:  [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.
        if ( saved || level == TExpDirLevel::transient || level == TExpDirLevel::system )
data/aghermann-1.1.2/src/aghermann/rk1968/rk1968.cc:237:77:  [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.
        auto make_error_return = [&L] ( const char* fmt, ...) [[gnu::format(printf, 2, 3)]] -> int
data/aghermann-1.1.2/src/aghermann/ui/globals.cc:52:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf( stderr, "Bad or missing " PACKAGE_DATADIR "/" PACKAGE "/" AGH_UI_GRESOURCE_FILE);
data/aghermann-1.1.2/src/aghermann/ui/mw/admit-one.cc:174:46:  [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.
                        const int cmd_exit = system( cmd.c_str());
data/aghermann-1.1.2/src/aghermann/ui/mw/mainmenu_cb.cc:262:39:  [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.
        for ( auto A : {TExpDirLevel::system, TExpDirLevel::user, TExpDirLevel::experiment} )
data/aghermann-1.1.2/src/aghermann/ui/mw/mainmenu_cb.cc:391:39:  [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.
        for ( auto A : {TExpDirLevel::system, TExpDirLevel::user, TExpDirLevel::experiment} )
data/aghermann-1.1.2/src/aghermann/ui/mw/measurements_cb.cc:263:14:  [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.
        if ( system( agh::str::sasprintf(
data/aghermann-1.1.2/src/aghermann/ui/mw/measurements_cb.cc:292:14:  [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.
        if ( system( exec.c_str()) )
data/aghermann-1.1.2/src/aghermann/ui/mw/mw.cc:393:14:  [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.
        if ( system( global::buf) ) {
data/aghermann-1.1.2/src/aghermann/ui/sf/ica.cc:42:30:  [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( (fname + ".orig").c_str(), F_OK) == -1 ) {
data/aghermann-1.1.2/src/aghermann/ui/sf/ica.cc:272:30:  [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.
                        if ( system(global::buf) )
data/aghermann-1.1.2/src/libsigfile/source-base.cc:334:14:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        if ( sscanf( rec_id_isolated.c_str(), T "," T,      int_episode, int_session) == 2 ||
data/aghermann-1.1.2/src/libsigfile/source-base.cc:335:14:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
             sscanf( rec_id_isolated.c_str(), T ":" T,      int_session, int_episode) == 2 ||
data/aghermann-1.1.2/src/libsigfile/source-base.cc:336:14:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
             sscanf( rec_id_isolated.c_str(), T "/"  T,     int_session, int_episode) == 2 ||
data/aghermann-1.1.2/src/libsigfile/source-base.cc:337:14:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
             sscanf( rec_id_isolated.c_str(), T " (" T ")", int_session, int_episode) == 2 )
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:373:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf( stderr, "Bad or missing " PACKAGE_DATADIR "/" PACKAGE "/" AGH_UI_GRESOURCE_FILE);
data/aghermann-1.1.2/src/aghermann/expdesign/dirlevel.cc:94:76:  [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.
                return move(str::sasprintf( "%s/.local/share/aghermann%s", getenv("HOME"), append.c_str()));
data/aghermann-1.1.2/src/aghermann/expdesign/expdesign.cc:254:74:  [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.
                return move(str::sasprintf( "%s/.local/share/aghermann", getenv("HOME")));
data/aghermann-1.1.2/src/aghermann/main.cc:46:22:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        while ( (c = getopt( argc, argv, "hnl:")) != -1 )
data/aghermann-1.1.2/src/aghermann/ui/mw/mw.cc:205:36:  [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.
                sure_dir = string (getenv("HOME")) + "/EmptyDummy";
data/aghermann-1.1.2/src/aghermann/ui/sm/sm.cc:52:27:  [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.
      : filename (string (getenv("HOME")) + "/.config/aghermann/sessionrc"),
data/aghermann-1.1.2/src/aghermann/ui/sm/sm.cc:75:61:  [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.
                        string new_experiment_dir = string (getenv("HOME")) + "/NewExperiment";
data/aghermann-1.1.2/src/common/libcommon.cc:158:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        const char *home = getenv("HOME");
data/aghermann-1.1.2/src/common/libcommon.cc:170:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        const char *home = getenv("HOME");
data/aghermann-1.1.2/src/common/libcommon.cc:181:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        const char *home = getenv("HOME");
data/aghermann-1.1.2/src/common/libcommon.cc:195:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        const char *home = getenv("HOME");
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:101:22:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        while ( (c = getopt( argc, argv, "h")) != -1 )
data/aghermann-1.1.2/src/aghermann/expdesign/expdesign.cc:127:17:  [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).
                open( lock_fname.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0600);
data/aghermann-1.1.2/src/aghermann/expdesign/expdesign.cc:574: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/aghermann/expdesign/tree-scanner.cc:94: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( &t0, localtime( &start_time_tmp), sizeof(struct tm));
data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc:44: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( X0.P, P.t, sizeof(double) * X.size());
data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc:45: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( X .P, P.t, sizeof(double) * X.size());
data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc:91: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( P.t, X.P, sizeof(double) * X.size());
data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc:101: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( P.R->tx.P, P.t, sizeof(double) * P.R->tx.size());
data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc:113: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( X1.P, P1.t, sizeof(double) * X1.size());
data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc:114: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( X2.P, P2.t, sizeof(double) * X2.size());
data/aghermann-1.1.2/src/aghermann/model/achermann-siman.cc:141: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( x0.t, tx.P, sizeof(double) * tx.size());
data/aghermann-1.1.2/src/aghermann/patterns/patterns.cc:64:20:  [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 *fd = fopen( fname.c_str(), "w");
data/aghermann-1.1.2/src/aghermann/patterns/patterns.cc:122:29:  [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).
                if ( !(fd = fopen( fname, "r")) )
data/aghermann-1.1.2/src/aghermann/rk1968/rk1968.cc:70: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 b[888];
data/aghermann-1.1.2/src/aghermann/ui/mw/measurements.cc:99: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( &tl_start_fixed_tm, localtime( &_p._p.timeline_start), sizeof(struct tm));
data/aghermann-1.1.2/src/aghermann/ui/sf/sf.cc:691:25:  [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 tmp[10];
data/aghermann-1.1.2/src/aghermann/ui/sf/sf.cc:702:17:  [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 tmp[10];
data/aghermann-1.1.2/src/common/libcommon.cc:102: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( (void*)r.data(), (const void*)r0.data(), min( to, r0.size()));
data/aghermann-1.1.2/src/common/libcommon.cc:145: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[32];
data/aghermann-1.1.2/src/common/log-facility.cc:59:26:  [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).
        else if ( !(_f = fopen( log_fname.c_str(), "w")) )
data/aghermann-1.1.2/src/common/log-facility.cc:95: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 timestampbuf[32 + 8 + 3];
data/aghermann-1.1.2/src/libmetrics/mc.cc:133: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/libmetrics/mc.cc:170: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/libmetrics/page-metrics-base.cc:191:20:  [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 ( (fd = open( fname.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0644)) == -1 ||
data/aghermann-1.1.2/src/libmetrics/page-metrics-base.cc:205:28:  [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 ( (fd = open( fname.c_str(), O_RDONLY)) == -1 )
data/aghermann-1.1.2/src/libmetrics/page-metrics-base.cc:241: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/libmetrics/psd.cc:197: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( fft_Ti, &S[p * sps], spp * sizeof(double));
data/aghermann-1.1.2/src/libmetrics/psd.cc:242: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/libmetrics/psd.cc:281: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/libmetrics/swu.cc:130: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/libsigfile/edf-io.cc:44: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( &tmp[ r_cnt * H.samples_per_record ],
data/aghermann-1.1.2/src/libsigfile/edf-io.cc:96: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( (char*)_mmapping + header_length
data/aghermann-1.1.2/src/libsigfile/edf-io.cc:104: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( (char*)_mmapping + header_length
data/aghermann-1.1.2/src/libsigfile/edf.cc:45: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( header.patient_id, pad( s, 80).c_str(), 80);
data/aghermann-1.1.2/src/libsigfile/edf.cc:54: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( header.recording_id, pad( s, 80).c_str(), 80);
data/aghermann-1.1.2/src/libsigfile/edf.cc:83: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( header.reserved, pad( s, 44).c_str(), 44);
data/aghermann-1.1.2/src/libsigfile/edf.cc:91: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( header.recording_date, s.c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:98: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( header.recording_time, s.c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:111: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.
const char version_string[8]  = {'0',' ',' ',' ', ' ',' ',' ',' '};
data/aghermann-1.1.2/src/libsigfile/edf.cc:127:15:  [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).
        _fd = open( fname_.c_str(), O_RDWR);
data/aghermann-1.1.2/src/libsigfile/edf.cc:199:15:  [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).
        _fd = open( fname_.c_str(), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP);
data/aghermann-1.1.2/src/libsigfile/page.cc:117: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( fname.c_str(), "w");
data/aghermann-1.1.2/src/libsigfile/source-base.cc:311: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 b[9];
data/aghermann-1.1.2/src/libsigfile/source-base.cc:331: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 int_session[81], int_episode[81];
data/aghermann-1.1.2/src/libsigfile/source-base.cc:504:20:  [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 *fd = fopen( fname.c_str(), "w");
data/aghermann-1.1.2/src/libsigfile/source-base.cc:521:20:  [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 *fd = fopen( fname.c_str(), "w");
data/aghermann-1.1.2/src/libsigfile/tsv.cc:50:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        _f = fopen( fname_.c_str(), "r");
data/aghermann-1.1.2/src/libsigfile/tsv.cc:89:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        _f = fopen( fname_.c_str(), "r");
data/aghermann-1.1.2/src/libsigfile/tsv.cc:385: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 b[20];
data/aghermann-1.1.2/src/tools/agh-profile-gen.cc:129:23:  [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).
                Q.h = atoi( arg);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:207: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( F.header.patient_id,     agh::str::pad( gtk_entry_get_text( e[PatientID]),     80).c_str(), 80);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:208: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( F.header.recording_id,   agh::str::pad( gtk_entry_get_text( e[RecordingID]),   80).c_str(), 80);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:209: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( F.header.recording_date, agh::str::pad( gtk_entry_get_text( e[RecordingDate]),  8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:210: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( F.header.recording_time, agh::str::pad( gtk_entry_get_text( e[RecordingTime]),  8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:211: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( F.header.reserved,       agh::str::pad( gtk_entry_get_text( e[Reserved]),      44).c_str(), 44);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:216: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( h.header.label,              pad( H->Label,           16).c_str(), 16);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:217: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( h.header.physical_dim,       pad( H->PhysicalDim,      8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:218: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( h.header.physical_min,       pad( H->PhysicalMin,      8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:219: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( h.header.physical_max,       pad( H->PhysicalMax,      8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:220: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( h.header.digital_min,        pad( H->DigitalMin,       8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:221: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( h.header.digital_max,        pad( H->DigitalMax,       8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:222: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( h.header.transducer_type,    pad( H->TransducerType,  80).c_str(), 80);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:223: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( h.header.filtering_info,     pad( H->FilteringInfo,   80).c_str(), 80);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:224: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( h.header.samples_per_record, pad( H->SamplesPerRecord, 8).c_str(),  8);
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:225: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( h.header.reserved,           pad( H->Reserved,        32).c_str(), 32);
data/aghermann-1.1.2/src/tools/edfhed.cc:103:25:  [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 p[21], v[81];  // make it 20
data/aghermann-1.1.2/src/tools/edfhed.cc:242:25:  [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 date_buf[9], time_buf[9];
data/aghermann-1.1.2/src/tools/edfhed.cc:250:25:  [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( F.header.recording_date,
data/aghermann-1.1.2/src/tools/edfhed.cc:252:25:  [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( F.header.recording_time,
data/aghermann-1.1.2/src/tools/edfhed.cc:314: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( F.header.patient_id,
data/aghermann-1.1.2/src/tools/edfhed.cc:316: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( F.header.recording_id,
data/aghermann-1.1.2/src/tools/edfhed.cc:354:49:  [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( F.header.version_number,
data/aghermann-1.1.2/src/tools/edfhed.cc:358:49:  [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( F.header.patient_id,
data/aghermann-1.1.2/src/tools/edfhed.cc:362:49:  [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( F.header.recording_id,
data/aghermann-1.1.2/src/tools/edfhed.cc:366:49:  [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( F.header.recording_date,
data/aghermann-1.1.2/src/tools/edfhed.cc:370:49:  [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( F.header.recording_time,
data/aghermann-1.1.2/src/tools/edfhed.cc:374:49:  [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( F.header.reserved,
data/aghermann-1.1.2/src/tools/edfhed.cc:379:49:  [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( F[S.channel].header.label,
data/aghermann-1.1.2/src/tools/edfhed.cc:383:49:  [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( F[S.channel].header.transducer_type,
data/aghermann-1.1.2/src/tools/edfhed.cc:387:49:  [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( F[S.channel].header.physical_dim,
data/aghermann-1.1.2/src/tools/edfhed.cc:391:49:  [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( F[S.channel].header.physical_min,
data/aghermann-1.1.2/src/tools/edfhed.cc:395:49:  [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( F[S.channel].header.physical_max,
data/aghermann-1.1.2/src/tools/edfhed.cc:399:49:  [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( F[S.channel].header.digital_min,
data/aghermann-1.1.2/src/tools/edfhed.cc:403:49:  [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( F[S.channel].header.digital_max,
data/aghermann-1.1.2/src/tools/edfhed.cc:407:49:  [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( F[S.channel].header.filtering_info,
data/aghermann-1.1.2/src/tools/edfhed.cc:411:49:  [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( F[S.channel].header.reserved,
data/aghermann-1.1.2/src/aghermann/expdesign/expdesign.cc:125:49:  [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)strlen(lock_mtime_s)-1, lock_mtime_s, lock_fname.c_str()));
data/aghermann-1.1.2/src/aghermann/expdesign/tree-scanner.cc:259: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).
                int fnlen = strlen(fname); // - ftw->base;
data/aghermann-1.1.2/src/aghermann/main.cc:61:44:  [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 ( (!explicit_session || strlen(explicit_session) == 0) ) {
data/aghermann-1.1.2/src/aghermann/ui/sf/montage-menus_cb.cc:511: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 ( strlen(new_label) > 0 ) {
data/aghermann-1.1.2/src/aghermann/ui/sf/montage-menus_cb.cc:682: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 ( strlen( new_ann) == 0 && type == SAnnotation::TType::plain ) {
data/aghermann-1.1.2/src/aghermann/ui/sm/sm.cc:60:55:  [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).
        bool have_explicit_dir = (explicit_session && strlen(explicit_session) > 0);
data/aghermann-1.1.2/src/common/libcommon.cc:160:42:  [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 ( inplace.compare( 0, strlen(home), home) == 0 )
data/aghermann-1.1.2/src/common/libcommon.cc:161:45:  [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).
                        inplace.replace( 0, strlen(home), "~");
data/aghermann-1.1.2/src/common/libcommon.cc:172:42:  [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 ( inplace.compare( 0, strlen(home), home) == 0 )
data/aghermann-1.1.2/src/common/libcommon.cc:173:45:  [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).
                        inplace.replace( 0, strlen(home), "~");
data/aghermann-1.1.2/src/common/libcommon.cc:360: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).
                int fnlen = strlen(fname); // - ftw->base;
data/aghermann-1.1.2/src/common/log-facility.cc:126: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).
                                         (int)strlen(issuer), mline,
data/aghermann-1.1.2/src/libmetrics/mc.cc:146: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).
                 (int)strlen(asctime_)-1, asctime_,
data/aghermann-1.1.2/src/libmetrics/mc.cc:180: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).
                 (int)strlen(asctime_)-1, asctime_,
data/aghermann-1.1.2/src/libmetrics/page-metrics-base.cc:208:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if ( read( fd, &_data[0], _data.size() * sizeof(TFloat))
data/aghermann-1.1.2/src/libmetrics/page-metrics-base.cc:214:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if ( read( fd, &whyme, 1) > 0 ) {
data/aghermann-1.1.2/src/libmetrics/page-metrics-base.cc:252: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).
                 (int)strlen(asctime_)-1, asctime_,
data/aghermann-1.1.2/src/libmetrics/psd.cc:255: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).
                 (int)strlen(asctime_)-1, asctime_,
data/aghermann-1.1.2/src/libmetrics/psd.cc:291: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).
                 (int)strlen(asctime_)-1, asctime_,
data/aghermann-1.1.2/src/libmetrics/swu.cc:140:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                 (int)strlen(asctime_)-1, asctime_,
data/aghermann-1.1.2/src/libsigfile/channel.cc:89:81:  [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 0 == strncasecmp(x.c_str(), canonical, strlen(canonical));
data/aghermann-1.1.2/src/libsigfile/channel.cc:121:67:  [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 ( 0 != strncasecmp(T0.c_str(), derived_type_s, strlen(derived_type_s)) ) {
data/aghermann-1.1.2/src/libsigfile/edf.cc:234:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.version_number, version_string, 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:243:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.header_length,    pad( to_string(header_length),    8).c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:244:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.data_record_size, pad( to_string(data_record_size), 8).c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:245:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.n_data_records,   pad( to_string(n_data_records),   8).c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:246:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.n_channels,       pad( to_string(channels_.size()), 4).c_str(), 4);
data/aghermann-1.1.2/src/libsigfile/edf.cc:254:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy( H.header.label,
data/aghermann-1.1.2/src/libsigfile/edf.cc:257:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy( H.header.transducer_type,
data/aghermann-1.1.2/src/libsigfile/edf.cc:259:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy( H.header.physical_dim,
data/aghermann-1.1.2/src/libsigfile/edf.cc:267:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy( H.header.filtering_info,
data/aghermann-1.1.2/src/libsigfile/edf.cc:269:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy( H.header.samples_per_record,
data/aghermann-1.1.2/src/libsigfile/edf.cc:284:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.physical_min, pad( to_string( physical_min = m), 8).c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:285:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.physical_max, pad( to_string( physical_max = M), 8).c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:293:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.digital_min, pad( to_string( digital_min = m), 8).c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:294:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( header.digital_max, pad( to_string( digital_max = M), 8).c_str(), 8);
data/aghermann-1.1.2/src/libsigfile/edf.cc:724: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).
                                offset_p = tals_p + strlen(tals_p) + 1;
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:285:14:  [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(str) != 8 || p == NULL || *p != '\0' )
data/aghermann-1.1.2/src/tools/edfhed-gtk.cc:289:14:  [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(str) != 8 || p == NULL || *p != '\0' )
data/aghermann-1.1.2/src/tools/edfhed.cc:104:35:  [1] (buffer) sscanf:
  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.
                        if ( 3 == sscanf( pv, "%u:%20[a-z_]:%80s", &h, p, v) && h != -1 ) {
data/aghermann-1.1.2/src/tools/edfhed.cc:133:42:  [1] (buffer) sscanf:
  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.
                        } else if ( 2 == sscanf( pv, "%20[a-z_]:%80s", p, v) ) {

ANALYSIS SUMMARY:

Hits = 160
Lines analyzed = 26173 in approximately 0.58 seconds (44989 lines/second)
Physical Source Lines of Code (SLOC) = 19906
Hits@level = [0] 134 [1]  41 [2]  85 [3]  11 [4]  23 [5]   0
Hits@level+ = [0+] 294 [1+] 160 [2+] 119 [3+]  34 [4+]  23 [5+]   0
Hits/KSLOC@level+ = [0+] 14.7694 [1+] 8.03778 [2+] 5.9781 [3+] 1.70803 [4+] 1.15543 [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.