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/backward-cpp-1.5/backward.cpp
Examining data/backward-cpp-1.5/backward.hpp
Examining data/backward-cpp-1.5/test/_test_main.cpp
Examining data/backward-cpp-1.5/test/rectrace.cpp
Examining data/backward-cpp-1.5/test/select_signals.cpp
Examining data/backward-cpp-1.5/test/stacktrace.cpp
Examining data/backward-cpp-1.5/test/suicide.cpp
Examining data/backward-cpp-1.5/test/test.cpp
Examining data/backward-cpp-1.5/test/test.hpp
Examining data/backward-cpp-1.5/test_package/main.cpp

FINAL RESULTS:

data/backward-cpp-1.5/backward.hpp:1042:13:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
          ::readlink(symlink_path.c_str(), &*path.begin(), path.size());
data/backward-cpp-1.5/backward.hpp:3370:7:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      printf(lpMsgBuf);
data/backward-cpp-1.5/test/_test_main.cpp:59:3:  [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(stderr, format, args);
data/backward-cpp-1.5/backward.hpp:3522:37:  [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* prefixes_str = std::getenv("BACKWARD_CXX_SOURCE_PREFIXES");
data/backward-cpp-1.5/backward.hpp:1300:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = open(filename_object.c_str(), O_RDONLY);
data/backward-cpp-1.5/backward.hpp:2043:23:  [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).
    file_handle.reset(open(filename_object.c_str(), O_RDONLY));
data/backward-cpp-1.5/backward.hpp:2155: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).
      debuglink_file.reset(open(debuglink.c_str(), O_RDONLY));
data/backward-cpp-1.5/backward.hpp:3296: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 temp[buffer_length];
data/backward-cpp-1.5/backward.hpp:3345: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[max_sym_len];
data/backward-cpp-1.5/backward.hpp:3353: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 name[256];
data/backward-cpp-1.5/backward.hpp:4115:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(ctx(), ct, sizeof(CONTEXT));
data/backward-cpp-1.5/test/_test_main.cpp:42:1:  [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 argv0[MAX_PATH];
data/backward-cpp-1.5/test/_test_main.cpp:87: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 filename[256];
data/backward-cpp-1.5/backward.hpp:3217: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).
    char *p = filename + strlen(filename) - 1;
data/backward-cpp-1.5/backward.hpp:3246:33:  [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).
      filename_end = filename + strlen(filename);
data/backward-cpp-1.5/test/test.hpp:60:39:  [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 char *basename = filename + strlen(filename);

ANALYSIS SUMMARY:

Hits = 16
Lines analyzed = 5031 in approximately 0.12 seconds (40720 lines/second)
Physical Source Lines of Code (SLOC) = 3527
Hits@level = [0]  15 [1]   3 [2]   9 [3]   1 [4]   2 [5]   1
Hits@level+ = [0+]  31 [1+]  16 [2+]  13 [3+]   4 [4+]   3 [5+]   1
Hits/KSLOC@level+ = [0+] 8.78934 [1+] 4.53643 [2+] 3.68585 [3+] 1.13411 [4+] 0.850581 [5+] 0.283527
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.