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/ledger-3.2.1/lib/utfcpp/v2_0/samples/docsample.cpp
Examining data/ledger-3.2.1/lib/utfcpp/v2_0/source/utf8.h
Examining data/ledger-3.2.1/lib/utfcpp/v2_0/source/utf8/checked.h
Examining data/ledger-3.2.1/lib/utfcpp/v2_0/source/utf8/core.h
Examining data/ledger-3.2.1/lib/utfcpp/v2_0/source/utf8/unchecked.h
Examining data/ledger-3.2.1/src/account.cc
Examining data/ledger-3.2.1/src/account.h
Examining data/ledger-3.2.1/src/amount.cc
Examining data/ledger-3.2.1/src/amount.h
Examining data/ledger-3.2.1/src/annotate.cc
Examining data/ledger-3.2.1/src/annotate.h
Examining data/ledger-3.2.1/src/balance.cc
Examining data/ledger-3.2.1/src/balance.h
Examining data/ledger-3.2.1/src/chain.cc
Examining data/ledger-3.2.1/src/chain.h
Examining data/ledger-3.2.1/src/commodity.cc
Examining data/ledger-3.2.1/src/commodity.h
Examining data/ledger-3.2.1/src/compare.cc
Examining data/ledger-3.2.1/src/compare.h
Examining data/ledger-3.2.1/src/context.h
Examining data/ledger-3.2.1/src/convert.cc
Examining data/ledger-3.2.1/src/convert.h
Examining data/ledger-3.2.1/src/csv.cc
Examining data/ledger-3.2.1/src/csv.h
Examining data/ledger-3.2.1/src/draft.cc
Examining data/ledger-3.2.1/src/draft.h
Examining data/ledger-3.2.1/src/emacs.cc
Examining data/ledger-3.2.1/src/emacs.h
Examining data/ledger-3.2.1/src/error.cc
Examining data/ledger-3.2.1/src/error.h
Examining data/ledger-3.2.1/src/expr.cc
Examining data/ledger-3.2.1/src/expr.h
Examining data/ledger-3.2.1/src/exprbase.h
Examining data/ledger-3.2.1/src/filters.cc
Examining data/ledger-3.2.1/src/filters.h
Examining data/ledger-3.2.1/src/flags.h
Examining data/ledger-3.2.1/src/format.cc
Examining data/ledger-3.2.1/src/format.h
Examining data/ledger-3.2.1/src/generate.cc
Examining data/ledger-3.2.1/src/generate.h
Examining data/ledger-3.2.1/src/global.cc
Examining data/ledger-3.2.1/src/global.h
Examining data/ledger-3.2.1/src/history.cc
Examining data/ledger-3.2.1/src/history.h
Examining data/ledger-3.2.1/src/item.cc
Examining data/ledger-3.2.1/src/item.h
Examining data/ledger-3.2.1/src/iterators.cc
Examining data/ledger-3.2.1/src/iterators.h
Examining data/ledger-3.2.1/src/journal.cc
Examining data/ledger-3.2.1/src/journal.h
Examining data/ledger-3.2.1/src/lookup.cc
Examining data/ledger-3.2.1/src/lookup.h
Examining data/ledger-3.2.1/src/main.cc
Examining data/ledger-3.2.1/src/mask.cc
Examining data/ledger-3.2.1/src/mask.h
Examining data/ledger-3.2.1/src/op.cc
Examining data/ledger-3.2.1/src/op.h
Examining data/ledger-3.2.1/src/option.cc
Examining data/ledger-3.2.1/src/option.h
Examining data/ledger-3.2.1/src/output.cc
Examining data/ledger-3.2.1/src/output.h
Examining data/ledger-3.2.1/src/parser.cc
Examining data/ledger-3.2.1/src/parser.h
Examining data/ledger-3.2.1/src/pool.cc
Examining data/ledger-3.2.1/src/pool.h
Examining data/ledger-3.2.1/src/post.cc
Examining data/ledger-3.2.1/src/post.h
Examining data/ledger-3.2.1/src/precmd.cc
Examining data/ledger-3.2.1/src/precmd.h
Examining data/ledger-3.2.1/src/predicate.h
Examining data/ledger-3.2.1/src/print.cc
Examining data/ledger-3.2.1/src/print.h
Examining data/ledger-3.2.1/src/pstream.h
Examining data/ledger-3.2.1/src/ptree.cc
Examining data/ledger-3.2.1/src/ptree.h
Examining data/ledger-3.2.1/src/py_account.cc
Examining data/ledger-3.2.1/src/py_amount.cc
Examining data/ledger-3.2.1/src/py_balance.cc
Examining data/ledger-3.2.1/src/py_commodity.cc
Examining data/ledger-3.2.1/src/py_expr.cc
Examining data/ledger-3.2.1/src/py_format.cc
Examining data/ledger-3.2.1/src/py_item.cc
Examining data/ledger-3.2.1/src/py_journal.cc
Examining data/ledger-3.2.1/src/py_post.cc
Examining data/ledger-3.2.1/src/py_session.cc
Examining data/ledger-3.2.1/src/py_times.cc
Examining data/ledger-3.2.1/src/py_utils.cc
Examining data/ledger-3.2.1/src/py_value.cc
Examining data/ledger-3.2.1/src/py_xact.cc
Examining data/ledger-3.2.1/src/pyfstream.h
Examining data/ledger-3.2.1/src/pyinterp.cc
Examining data/ledger-3.2.1/src/pyinterp.h
Examining data/ledger-3.2.1/src/pyledger.cc
Examining data/ledger-3.2.1/src/pyutils.h
Examining data/ledger-3.2.1/src/query.cc
Examining data/ledger-3.2.1/src/query.h
Examining data/ledger-3.2.1/src/quotes.cc
Examining data/ledger-3.2.1/src/quotes.h
Examining data/ledger-3.2.1/src/report.cc
Examining data/ledger-3.2.1/src/report.h
Examining data/ledger-3.2.1/src/scope.cc
Examining data/ledger-3.2.1/src/scope.h
Examining data/ledger-3.2.1/src/select.cc
Examining data/ledger-3.2.1/src/select.h
Examining data/ledger-3.2.1/src/session.cc
Examining data/ledger-3.2.1/src/session.h
Examining data/ledger-3.2.1/src/stats.cc
Examining data/ledger-3.2.1/src/stats.h
Examining data/ledger-3.2.1/src/stream.cc
Examining data/ledger-3.2.1/src/stream.h
Examining data/ledger-3.2.1/src/strptime.cc
Examining data/ledger-3.2.1/src/strptime.h
Examining data/ledger-3.2.1/src/temps.cc
Examining data/ledger-3.2.1/src/temps.h
Examining data/ledger-3.2.1/src/textual.cc
Examining data/ledger-3.2.1/src/timelog.cc
Examining data/ledger-3.2.1/src/timelog.h
Examining data/ledger-3.2.1/src/times.cc
Examining data/ledger-3.2.1/src/times.h
Examining data/ledger-3.2.1/src/token.cc
Examining data/ledger-3.2.1/src/token.h
Examining data/ledger-3.2.1/src/unistring.h
Examining data/ledger-3.2.1/src/utils.cc
Examining data/ledger-3.2.1/src/utils.h
Examining data/ledger-3.2.1/src/value.cc
Examining data/ledger-3.2.1/src/value.h
Examining data/ledger-3.2.1/src/views.cc
Examining data/ledger-3.2.1/src/views.h
Examining data/ledger-3.2.1/src/wcwidth.cc
Examining data/ledger-3.2.1/src/xact.cc
Examining data/ledger-3.2.1/src/xact.h
Examining data/ledger-3.2.1/test/unit/t_amount.cc
Examining data/ledger-3.2.1/test/unit/t_balance.cc
Examining data/ledger-3.2.1/test/unit/t_commodity.cc
Examining data/ledger-3.2.1/test/unit/t_expr.cc
Examining data/ledger-3.2.1/test/unit/t_times.cc
Examining data/ledger-3.2.1/test/unit/t_value.cc

FINAL RESULTS:

data/ledger-3.2.1/src/amount.cc:638: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).
  std::strcpy(buf.get(), out.str().c_str());
data/ledger-3.2.1/src/filters.cc:1483: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).
  std::strcpy(buf.get(), tag_list.c_str());
data/ledger-3.2.1/src/global.cc:458:5:  [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("man", "man", "1", "ledger", NULL);
data/ledger-3.2.1/src/item.cc:174: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).
  std::strcpy(buf.get(), p);
data/ledger-3.2.1/src/pool.cc:374: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).
  std::strcpy(buf.get(), str.c_str());
data/ledger-3.2.1/src/pyinterp.cc:350: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).
  std::strcpy(argv[0], argv0);
data/ledger-3.2.1/src/pyinterp.cc:355:10:  [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).
    std::strcpy(argv[i + 1], arg.c_str());
data/ledger-3.2.1/src/quotes.cc:66:19:  [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.
  if (FILE * fp = popen(getquote_cmd.c_str(), "r")) {
data/ledger-3.2.1/src/report.cc:640: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).
  std::strcpy(buf.get(), temp.c_str());
data/ledger-3.2.1/src/stream.cc:83:7:  [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("/bin/sh", "/bin/sh", "-c", pager_path.string().c_str(), NULL);
data/ledger-3.2.1/src/textual.cc:1261: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).
  std::strcpy(buf, line);
data/ledger-3.2.1/src/textual.cc:1413: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).
  std::strcpy(buf, line);
data/ledger-3.2.1/src/times.cc:134:10:  [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).
    std::strcpy(buf, date_str);
data/ledger-3.2.1/src/times.cc:245: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).
  std::strcpy(buf, str);
data/ledger-3.2.1/src/utils.cc:384: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).
  std::strcpy(name, cls_name);
data/ledger-3.2.1/src/utils.cc:386:8:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
  std::strcat(name, args);
data/ledger-3.2.1/src/global.cc:143:38:  [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.
    if (const char * home_var = std::getenv("HOME")) {
data/ledger-3.2.1/src/global.cc:388:29:  [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.
  if (const char * p = std::getenv("LEDGER")) {
data/ledger-3.2.1/src/global.cc:389:16:  [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.
    if (! std::getenv("LEDGER_FILE"))
data/ledger-3.2.1/src/global.cc:392:29:  [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.
  if (const char * p = std::getenv("LEDGER_INIT")) {
data/ledger-3.2.1/src/global.cc:393:16:  [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.
    if (! std::getenv("LEDGER_INIT_FILE"))
data/ledger-3.2.1/src/global.cc:396:29:  [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.
  if (const char * p = std::getenv("PRICE_HIST")) {
data/ledger-3.2.1/src/global.cc:397:16:  [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.
    if (! std::getenv("LEDGER_PRICE_DB"))
data/ledger-3.2.1/src/global.cc:400:29:  [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.
  if (const char * p = std::getenv("PRICE_EXP")) {
data/ledger-3.2.1/src/global.cc:401:16:  [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.
    if (! std::getenv("LEDGER_PRICE_EXP"))
data/ledger-3.2.1/src/report.cc:191:40:  [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.
  else if (const char * columns = std::getenv("COLUMNS"))
data/ledger-3.2.1/src/report.h:814:17:  [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.
     if (! std::getenv("PAGER") && isatty(STDOUT_FILENO)) {
data/ledger-3.2.1/src/select.cc:153:48:  [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.
      else if (const char * columns_env = std::getenv("COLUMNS"))
data/ledger-3.2.1/src/session.cc:75:38:  [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.
    if (const char * home_var = std::getenv("HOME"))
data/ledger-3.2.1/src/session.cc:101:38:  [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.
    if (const char * home_var = std::getenv("HOME")) {
data/ledger-3.2.1/src/utils.cc:648:31:  [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.
    if (const char * p = std::getenv("LEDGER_DEBUG")) {
data/ledger-3.2.1/src/utils.cc:809:16:  [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.
    pfx = std::getenv("HOME");
data/ledger-3.2.1/src/account.cc:59: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 buf[8192];
data/ledger-3.2.1/src/amount.cc:976: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[256];
data/ledger-3.2.1/src/annotate.cc:88: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[256];
data/ledger-3.2.1/src/commodity.cc:288: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.
  foreach (char ch, symbol)
data/ledger-3.2.1/src/commodity.cc:299: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 buf[256];
data/ledger-3.2.1/src/context.h:66: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                   linebuf[MAX_LINE + 1];
data/ledger-3.2.1/src/context.h:97:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    std::memcpy(linebuf, context.linebuf, MAX_LINE);
data/ledger-3.2.1/src/expr.cc:148:11:  [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 linebuf[1024];
data/ledger-3.2.1/src/expr.cc:295: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                   buf[4096];
data/ledger-3.2.1/src/format.cc:133:10:  [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 buf[65535];
data/ledger-3.2.1/src/global.cc:160:10:  [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 prompt[32];
data/ledger-3.2.1/src/item.cc:156:11:  [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[256];
data/ledger-3.2.1/src/main.cc:111: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 line[1024];
data/ledger-3.2.1/src/main.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 line[1024];
data/ledger-3.2.1/src/option.cc:43: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[128];
data/ledger-3.2.1/src/option.cc:69: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[4];
data/ledger-3.2.1/src/option.cc:126: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.
      char   buf[8192];
data/ledger-3.2.1/src/pyfstream.h:58: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.
      char z[2];
data/ledger-3.2.1/src/pyfstream.h:114: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 buffer[bufSize + pbSize];      // data buffer
data/ledger-3.2.1/src/pyinterp.cc: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 buf[256];
data/ledger-3.2.1/src/pyinterp.cc:334:25:  [2] (buffer) wchar_t:
  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.
  wchar_t ** argv = new wchar_t *[args.size() + 1];
data/ledger-3.2.1/src/pyinterp.cc:347:22:  [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 ** argv = new char *[args.size() + 1];
data/ledger-3.2.1/src/quotes.cc:52: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 buf[256];
data/ledger-3.2.1/src/session.cc:156: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 line[8192];
data/ledger-3.2.1/src/textual.cc:1259: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 buf[8192];
data/ledger-3.2.1/src/textual.cc:1412: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 buf[parse_context_t::MAX_LINE + 1];
data/ledger-3.2.1/src/timelog.cc:57: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[32];
data/ledger-3.2.1/src/timelog.cc:58:10:  [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.
    std::sprintf(buf, "%lds", long((out_event.checkin - in_event.checkin)
data/ledger-3.2.1/src/times.cc:76: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.
      char buf[128];
data/ledger-3.2.1/src/times.cc:133: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[128];
data/ledger-3.2.1/src/times.cc:244: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 buf[128];
data/ledger-3.2.1/src/token.cc:47: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[6];
data/ledger-3.2.1/src/token.cc:71:14:  [2] (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). Risk is low because the source is a constant string.
        std::strcpy(symbol, "else");
data/ledger-3.2.1/src/token.cc:79:14:  [2] (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). Risk is low because the source is a constant string.
        std::strcpy(symbol, "false");
data/ledger-3.2.1/src/token.cc:116:14:  [2] (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). Risk is low because the source is a constant string.
        std::strcpy(symbol, "true");
data/ledger-3.2.1/src/token.cc:134: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 c, buf[256];
data/ledger-3.2.1/src/token.cc:199: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[256];
data/ledger-3.2.1/src/token.cc: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 buf[4096];
data/ledger-3.2.1/src/token.cc:306: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.
      char buf[4096];
data/ledger-3.2.1/src/token.h:99: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        symbol[6];
data/ledger-3.2.1/src/utils.cc:383:10:  [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 name[1024];
data/ledger-3.2.1/src/utils.cc:514: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 buf[4096];
data/ledger-3.2.1/src/account.cc:69:10:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    std::strncpy(buf, acct_name.c_str(), sep);
data/ledger-3.2.1/src/amount.cc:153:40:  [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::size_type index = std::strlen(buf);
data/ledger-3.2.1/src/amount.cc:981:34:  [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::size_type len = std::strlen(buf);
data/ledger-3.2.1/src/error.cc:99:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  in.read(buf.get(), static_cast<std::streamsize>(len));
data/ledger-3.2.1/src/expr.cc:110:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    in.read(buf.get(), len);
data/ledger-3.2.1/src/format.cc:103:17:  [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).
      p += std::strlen(p);
data/ledger-3.2.1/src/generate.cc:368:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (session.journal->read(parsing_context) != 0) {
data/ledger-3.2.1/src/global.cc:119:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (session().journal->read(parsing_context) > 0 ||
data/ledger-3.2.1/src/item.cc:157:16:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          std::strncpy(buf, b + 1, static_cast<std::size_t>(e - b - 1));
data/ledger-3.2.1/src/item.cc:172:40:  [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).
  scoped_array<char> buf(new char[std::strlen(p) + 1]);
data/ledger-3.2.1/src/item.cc:182:40:  [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 string::size_type len = std::strlen(q);
data/ledger-3.2.1/src/iterators.h:79:8:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
  bool equal(iterator_facade_base const& other) const {
data/ledger-3.2.1/src/journal.cc:55:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  read(pathname);
data/ledger-3.2.1/src/journal.cc:62:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  read(str);
data/ledger-3.2.1/src/journal.cc:453:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
std::size_t journal_t::read(parse_context_stack_t& context)
data/ledger-3.2.1/src/journal.h:189:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  std::size_t read(parse_context_stack_t& context);
data/ledger-3.2.1/src/option.cc:125: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 (std::strlen(*p) >= tag_len && std::strncmp(*p, tag_p, tag_len) == 0) {
data/ledger-3.2.1/src/option.h:69:34:  [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).
    : name(_name), name_len(std::strlen(name)), ch(_ch),
data/ledger-3.2.1/src/precmd.cc:77:33:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        report.session.journal->read(parsing_context);
data/ledger-3.2.1/src/pstream.h:62: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).
        len = std::strlen(ptr);
data/ledger-3.2.1/src/py_journal.cc:146:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return journal.read(context_stack);
data/ledger-3.2.1/src/pyfstream.h:71:10:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    std::strncpy(buf, s, static_cast<std::size_t>(num));
data/ledger-3.2.1/src/pyinterp.cc:336: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).
  std::size_t len = std::strlen(argv0) + 1;
data/ledger-3.2.1/src/pyinterp.cc:349: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).
  argv[0] = new char[std::strlen(argv0) + 1];
data/ledger-3.2.1/src/session.cc:137:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (journal->read(parsing_context) > 0)
data/ledger-3.2.1/src/session.cc:157:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        std::cin.read(line, 8192);
data/ledger-3.2.1/src/session.cc:172:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      xact_count += journal->read(parsing_context);
data/ledger-3.2.1/src/session.cc:233:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    journal->read(parsing_context);
data/ledger-3.2.1/src/strptime.cc:91:34:  [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).
          len = static_cast<int>(strlen(kWeekFull[i]));
data/ledger-3.2.1/src/strptime.cc:97:34:  [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).
          len = static_cast<int>(strlen(kWeekAbbr[i]));
data/ledger-3.2.1/src/strptime.cc:113:34:  [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).
          len = static_cast<int>(strlen(kMonthFull[i]));
data/ledger-3.2.1/src/strptime.cc:119:34:  [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).
          len = static_cast<int>(strlen(kMonthAbbr[i]));
data/ledger-3.2.1/src/textual.cc:433:18:  [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 (std::strlen(line+1) == 0)
data/ledger-3.2.1/src/textual.cc:591: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 std::size_t remlen = std::strlen(p);
data/ledger-3.2.1/src/textual.cc:1451: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).
  char * e = p + std::strlen(p);
data/ledger-3.2.1/src/textual.cc:1890:37:  [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 std::size_t remlen = std::strlen(p);
data/ledger-3.2.1/src/times.cc:129: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 (std::strlen(date_str) > 127) {
data/ledger-3.2.1/src/times.cc:240: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).
  if (std::strlen(str) > 127) {
data/ledger-3.2.1/src/utils.cc:385:8:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
  std::strcat(name, "(");
data/ledger-3.2.1/src/utils.cc:387:8:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
  std::strcat(name, ")");
data/ledger-3.2.1/src/utils.h:515: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).
  std::size_t len = std::strlen(ptr);

ANALYSIS SUMMARY:

Hits = 115
Lines analyzed = 51230 in approximately 2.07 seconds (24768 lines/second)
Physical Source Lines of Code (SLOC) = 37484
Hits@level = [0]   0 [1]  41 [2]  42 [3]  16 [4]  16 [5]   0
Hits@level+ = [0+] 115 [1+] 115 [2+]  74 [3+]  32 [4+]  16 [5+]   0
Hits/KSLOC@level+ = [0+] 3.06798 [1+] 3.06798 [2+] 1.97418 [3+] 0.853698 [4+] 0.426849 [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.