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/cnrun-2.1.0/src/libstilton/libstilton.cc
Examining data/cnrun-2.1.0/src/libcnrun/model/cycle.cc
Examining data/cnrun-2.1.0/src/libcnrun/model/nmlio.cc
Examining data/cnrun-2.1.0/src/libcnrun/model/sources.cc
Examining data/cnrun-2.1.0/src/libcnrun/model/struct.cc
Examining data/cnrun-2.1.0/src/libcnrun/model/tags.cc
Examining data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc
Examining data/cnrun-2.1.0/src/libcnrun/units/hosted-neurons.cc
Examining data/cnrun-2.1.0/src/libcnrun/units/hosted-synapses.cc
Examining data/cnrun-2.1.0/src/libcnrun/units/standalone-neurons.cc
Examining data/cnrun-2.1.0/src/libcnrun/units/standalone-synapses.cc
Examining data/cnrun-2.1.0/src/libcnrun/units/types.cc
Examining data/cnrun-2.1.0/src/lua-cnrun/commands.cc
Examining data/cnrun-2.1.0/src/tools/hh-latency-estimator.cc
Examining data/cnrun-2.1.0/src/tools/spike2sdf.cc

FINAL RESULTS:

data/cnrun-2.1.0/src/libstilton/libstilton.cc:41:17:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                vprintf( fmt, ap);
data/cnrun-2.1.0/src/libstilton/libstilton.cc:53:17:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                vfprintf( f, fmt, ap);
data/cnrun-2.1.0/src/lua-cnrun/commands.cc:35:78:  [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.
int make_error( lua_State *L, const char *fmt, ...)  __attribute__ ((format (printf, 2, 3)));
data/cnrun-2.1.0/src/libstilton/libstilton.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/cnrun-2.1.0/src/libstilton/libstilton.cc:182: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/cnrun-2.1.0/src/libstilton/libstilton.cc:193: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/cnrun-2.1.0/src/libstilton/libstilton.cc:207: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/cnrun-2.1.0/src/tools/hh-latency-estimator.cc:273: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, "f:l:y:oc:S:T:h")) != -1 )
data/cnrun-2.1.0/src/libcnrun/model/nmlio.cc:561:30:  [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* fout = fopen( fname.c_str(), "w");
data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:206:36:  [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).
                _binwrite_handle = open( (string(_label)+".varx").c_str(), O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR | S_IWUSR);
data/cnrun-2.1.0/src/libstilton/libstilton.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( (void*)r.data(), (const void*)r0.data(), min( to, r0.size()));
data/cnrun-2.1.0/src/libstilton/libstilton.cc:157: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/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:86: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(id) > max_id_size ) {
data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:90: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(id) == 0 ) {
data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:94: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(pop) == 0 ) {
data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:113:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( _label, prelabel.c_str(), max_label_size);
data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:115:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy( _population, pop_, max_label_size);
data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:117:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy( _id,         id,   max_id_size);
data/cnrun-2.1.0/src/libcnrun/units/base-unit.cc:119: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).
        M -> update_longest_label( strlen(_label));
data/cnrun-2.1.0/src/libstilton/libstilton.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/cnrun-2.1.0/src/libstilton/libstilton.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/cnrun-2.1.0/src/libstilton/libstilton.cc:184: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/cnrun-2.1.0/src/libstilton/libstilton.cc:185: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/cnrun-2.1.0/src/lua-cnrun/commands.cc:50:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        size_t  siglen = strlen(sig),

ANALYSIS SUMMARY:

Hits = 24
Lines analyzed = 7591 in approximately 0.23 seconds (33528 lines/second)
Physical Source Lines of Code (SLOC) = 5473
Hits@level = [0]  93 [1]  12 [2]   4 [3]   5 [4]   3 [5]   0
Hits@level+ = [0+] 117 [1+]  24 [2+]  12 [3+]   8 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 21.3777 [1+] 4.38516 [2+] 2.19258 [3+] 1.46172 [4+] 0.548145 [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.