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/tagcoll2-2.0.14/tagcoll/SmartHierarchy.h
Examining data/tagcoll2-2.0.14/tagcoll/expression-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/SmartHierarchy.cc
Examining data/tagcoll2-2.0.14/tagcoll/coll/intdiskindex.cc
Examining data/tagcoll2-2.0.14/tagcoll/coll/fast.h
Examining data/tagcoll2-2.0.14/tagcoll/coll/base.h
Examining data/tagcoll2-2.0.14/tagcoll/coll/simple-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/coll/simple.h
Examining data/tagcoll2-2.0.14/tagcoll/coll/intdiskindex.h
Examining data/tagcoll2-2.0.14/tagcoll/coll/patched.h
Examining data/tagcoll2-2.0.14/tagcoll/coll/intdiskindex-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/coll/patched-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/coll/fast-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/string-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/string.h
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/int.cc
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/int.h
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.h
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/string.cc
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/int-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/diskindex/mmap-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_l.cc
Examining data/tagcoll2-2.0.14/tagcoll/tagexpr/fmemopen.c
Examining data/tagcoll2-2.0.14/tagcoll/tagexpr/TagexprParser.cc
Examining data/tagcoll2-2.0.14/tagcoll/tagexpr/TagexprParser.h
Examining data/tagcoll2-2.0.14/tagcoll/tagexpr/fmemopen.h
Examining data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_y.cc
Examining data/tagcoll2-2.0.14/tagcoll/expression.h
Examining data/tagcoll2-2.0.14/tagcoll/patch.h
Examining data/tagcoll2-2.0.14/tagcoll/expression.cc
Examining data/tagcoll2-2.0.14/tagcoll/TextFormat.cc
Examining data/tagcoll2-2.0.14/tagcoll/input/base.h
Examining data/tagcoll2-2.0.14/tagcoll/input/memory.cc
Examining data/tagcoll2-2.0.14/tagcoll/input/zlib.cc
Examining data/tagcoll2-2.0.14/tagcoll/input/zlib.h
Examining data/tagcoll2-2.0.14/tagcoll/input/stdio.h
Examining data/tagcoll2-2.0.14/tagcoll/input/base.cc
Examining data/tagcoll2-2.0.14/tagcoll/input/string.h
Examining data/tagcoll2-2.0.14/tagcoll/input/stdio.cc
Examining data/tagcoll2-2.0.14/tagcoll/input/memory.h
Examining data/tagcoll2-2.0.14/tagcoll/input/string.cc
Examining data/tagcoll2-2.0.14/tagcoll/tests/tut-main.cpp
Examining data/tagcoll2-2.0.14/tagcoll/tests/test-utils.h
Examining data/tagcoll2-2.0.14/tagcoll/Implications.h
Examining data/tagcoll2-2.0.14/tagcoll/TextFormat.h
Examining data/tagcoll2-2.0.14/tagcoll/patch-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/TextFormat-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/utils/set.h
Examining data/tagcoll2-2.0.14/tagcoll/DerivedTags.h
Examining data/tagcoll2-2.0.14/tagcoll/SmartHierarchy-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/stream/expression-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/stream/sink-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/stream/sink.h
Examining data/tagcoll2-2.0.14/tagcoll/stream/expression.h
Examining data/tagcoll2-2.0.14/tagcoll/stream/filters-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/stream/substitutions-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/stream/substitutions.h
Examining data/tagcoll2-2.0.14/tagcoll/stream/filters.h
Examining data/tagcoll2-2.0.14/tagcoll/stream/patcher-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/stream/patcher.h
Examining data/tagcoll2-2.0.14/tagcoll/Implications-tut.cc
Examining data/tagcoll2-2.0.14/tagcoll/DerivedTags-tut.cc
Examining data/tagcoll2-2.0.14/tools/tagcoll.cc
Examining data/tagcoll2-2.0.14/tools/TagcollParser.h
Examining data/tagcoll2-2.0.14/tools/Timing.h
Examining data/tagcoll2-2.0.14/bench/collection.cc
Examining data/tagcoll2-2.0.14/bench/bench-main.cc
Examining data/tagcoll2-2.0.14/bench/Benchmark.cc
Examining data/tagcoll2-2.0.14/bench/Benchmark.h

FINAL RESULTS:

data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_y.cc:646:21:  [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.
#  define YYFPRINTF fprintf
data/tagcoll2-2.0.14/tools/Timing.h:44:10:  [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.
		    << system << " system, "
data/tagcoll2-2.0.14/tools/Timing.h:45:17:  [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.
		    << user + system << " total";
data/tagcoll2-2.0.14/bench/bench-main.cc:12:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
		srand(1);
data/tagcoll2-2.0.14/bench/collection.cc:52:74:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
		int res = (int)rint((double)min + ((double)max-(double)min)*(log(1.0 - drand48()) / log(p)));
data/tagcoll2-2.0.14/tagcoll/TextFormat-tut.cc:101: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 buf[1000];
data/tagcoll2-2.0.14/tagcoll/TextFormat-tut.cc:169: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 buf[1000];
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap-tut.cc:58:3:  [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(buf, data.c_str(), data.size() + 1);
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:72: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).
	if ((m_fd = open(m_filename.c_str(), O_RDONLY)) == -1)
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:134: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 name[filename.size() + 8];
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:135:2:  [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(name, filename.data(), filename.size());
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:136:2:  [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(name + filename.size(), ".XXXXXX", 8);
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:138:7:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	fd = mkstemp(name);
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:179: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 buf[size];
data/tagcoll2-2.0.14/tagcoll/diskindex/string.cc:110:3:  [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(buf + pos, i->c_str(), i->size() + 1);
data/tagcoll2-2.0.14/tagcoll/input/stdio.cc:32:32:  [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(fname), _line(1), _in(fopen(_file.c_str(), "rt")), _close_on_exit(true)
data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_y.cc:939: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_y.cc:1168: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 yymsgbuf[128];
data/tagcoll2-2.0.14/tagcoll/tagexpr/fmemopen.c:6:14:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    if ((f = tmpfile()) != NULL) {
data/tagcoll2-2.0.14/tagcoll/tests/tut-main.cpp:62:44:  [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).
      tut::runner.get().run_test(argv[1],::atoi(argv[2]));
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:159:16:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mode_t mask = umask(0);
data/tagcoll2-2.0.14/tagcoll/diskindex/mmap.cc:160:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(mask);
data/tagcoll2-2.0.14/tagcoll/input/stdio.cc:46:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int c = fgetc(_in);
data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_l.cc:602:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_l.cc:1561: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).
	return yy_scan_bytes(yystr,strlen(yystr) );
data/tagcoll2-2.0.14/tagcoll/tagexpr/Tagexpr_parser_y.cc:824:21:  [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).
#   define yystrlen strlen

ANALYSIS SUMMARY:

Hits = 26
Lines analyzed = 13353 in approximately 0.35 seconds (38683 lines/second)
Physical Source Lines of Code (SLOC) = 8418
Hits@level = [0]   9 [1]   6 [2]  15 [3]   2 [4]   3 [5]   0
Hits@level+ = [0+]  35 [1+]  26 [2+]  20 [3+]   5 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 4.15776 [1+] 3.08862 [2+] 2.37586 [3+] 0.593965 [4+] 0.356379 [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.