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/belr-4.4.0/include/belr/abnf.h
Examining data/belr-4.4.0/include/belr/belr.h
Examining data/belr-4.4.0/include/belr/grammarbuilder.h
Examining data/belr-4.4.0/include/belr/parser.h
Examining data/belr-4.4.0/src/abnf.cpp
Examining data/belr-4.4.0/src/belr.cpp
Examining data/belr-4.4.0/src/binarystream.cpp
Examining data/belr-4.4.0/src/binarystream.h
Examining data/belr-4.4.0/src/common.h
Examining data/belr-4.4.0/src/grammarbuilder.cpp
Examining data/belr-4.4.0/src/parser.cpp
Examining data/belr-4.4.0/tester/belr-tester.cpp
Examining data/belr-4.4.0/tester/belr-tester.h
Examining data/belr-4.4.0/tester/grammar-tester.cpp
Examining data/belr-4.4.0/tools/belr-compiler.cc
Examining data/belr-4.4.0/tools/belr-demo.cc
Examining data/belr-4.4.0/tools/belr-parse.cc

FINAL RESULTS:

data/belr-4.4.0/tester/belr-tester.cpp:70:2:  [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(lev == BCTBX_LOG_ERROR ? stderr : stdout, fmt, args);
data/belr-4.4.0/tester/belr-tester.cpp:76:2:  [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(lev == BCTBX_LOG_ERROR ? stderr : stdout, fmt, cap);
data/belr-4.4.0/include/belr/parser.h:72:84:  [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).
		mFunc(universal_pointer_cast<typename _functorT::first_argument_type>(obj), std::atoi(value.c_str()));
data/belr-4.4.0/src/belr.cpp:742:5:  [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).
	of.open(filename,ofstream::out|ofstream::trunc|ofstream::binary);
data/belr-4.4.0/src/belr.cpp:764:6:  [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).
	ifs.open(filename, ifstream::in|ifstream::binary);
data/belr-4.4.0/tester/belr-tester.cpp:46: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 prefix[200] = { 0 };
data/belr-4.4.0/tools/belr-parse.cc:49:18:  [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).
				repeat_count=atoi(argv[i]);
data/belr-4.4.0/tools/belr-parse.cc:65:6:  [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).
	ifs.open(file);
data/belr-4.4.0/tools/belr-parse.cc:70:2:  [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 marker[10] = {0};
data/belr-4.4.0/src/binarystream.cpp:38:2:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	read((char*)&tmp, sizeof(tmp));
data/belr-4.4.0/src/binarystream.cpp:44:2:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	read((char*)&ret, 1);
data/belr-4.4.0/src/binarystream.cpp:52:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		read((char*)&c, 1);
data/belr-4.4.0/tools/belr-parse.cc:71:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ifs.read(marker,sizeof(marker)-1);

ANALYSIS SUMMARY:

Hits = 13
Lines analyzed = 4087 in approximately 0.11 seconds (35840 lines/second)
Physical Source Lines of Code (SLOC) = 2877
Hits@level = [0]   3 [1]   4 [2]   7 [3]   0 [4]   2 [5]   0
Hits@level+ = [0+]  16 [1+]  13 [2+]   9 [3+]   2 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 5.56135 [1+] 4.5186 [2+] 3.12826 [3+] 0.695169 [4+] 0.695169 [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.