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/kelbt-0.16/src/buffer.h
Examining data/kelbt-0.16/src/pcheck.h
Examining data/kelbt-0.16/src/klparse.h
Examining data/kelbt-0.16/src/main.cpp
Examining data/kelbt-0.16/src/version.h
Examining data/kelbt-0.16/src/closure.cpp
Examining data/kelbt-0.16/src/klscan.cpp
Examining data/kelbt-0.16/src/fsmattach.cpp
Examining data/kelbt-0.16/src/fsmbase.cpp
Examining data/kelbt-0.16/src/fsmgraph.h
Examining data/kelbt-0.16/src/gvdotgen.cpp
Examining data/kelbt-0.16/src/codegen.cpp
Examining data/kelbt-0.16/src/pcheck.cpp
Examining data/kelbt-0.16/src/fsmgraph.cpp
Examining data/kelbt-0.16/src/parsedata.cpp
Examining data/kelbt-0.16/src/kelbt.h
Examining data/kelbt-0.16/src/parsedata.h
Examining data/kelbt-0.16/src/klparse.cpp
Examining data/kelbt-0.16/aapl/dlcommon.h
Examining data/kelbt-0.16/aapl/dlistmel.h
Examining data/kelbt-0.16/aapl/compare.h
Examining data/kelbt-0.16/aapl/avlbasic.h
Examining data/kelbt-0.16/aapl/bstset.h
Examining data/kelbt-0.16/aapl/insertsort.h
Examining data/kelbt-0.16/aapl/sbstset.h
Examining data/kelbt-0.16/aapl/avltree.h
Examining data/kelbt-0.16/aapl/bubblesort.h
Examining data/kelbt-0.16/aapl/bsttable.h
Examining data/kelbt-0.16/aapl/svector.h
Examining data/kelbt-0.16/aapl/avlkeyless.h
Examining data/kelbt-0.16/aapl/vector.h
Examining data/kelbt-0.16/aapl/avlikeyless.h
Examining data/kelbt-0.16/aapl/avlimel.h
Examining data/kelbt-0.16/aapl/dlistval.h
Examining data/kelbt-0.16/aapl/sbstmap.h
Examining data/kelbt-0.16/aapl/quicksort.h
Examining data/kelbt-0.16/aapl/sbsttable.h
Examining data/kelbt-0.16/aapl/resize.h
Examining data/kelbt-0.16/aapl/avlimap.h
Examining data/kelbt-0.16/aapl/avlset.h
Examining data/kelbt-0.16/aapl/avlmap.h
Examining data/kelbt-0.16/aapl/mergesort.h
Examining data/kelbt-0.16/aapl/avlibasic.h
Examining data/kelbt-0.16/aapl/avlmelkey.h
Examining data/kelbt-0.16/aapl/dlist.h
Examining data/kelbt-0.16/aapl/bstmap.h
Examining data/kelbt-0.16/aapl/avlitree.h
Examining data/kelbt-0.16/aapl/table.h
Examining data/kelbt-0.16/aapl/avlmel.h
Examining data/kelbt-0.16/aapl/avliset.h
Examining data/kelbt-0.16/aapl/avlimelkey.h
Examining data/kelbt-0.16/aapl/avlcommon.h
Examining data/kelbt-0.16/aapl/bstcommon.h

FINAL RESULTS:

data/kelbt-0.16/src/main.cpp:134:2:  [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).
	strcpy( retVal + len, suffix );
data/kelbt-0.16/src/parsedata.cpp:153:2:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	access(0),
data/kelbt-0.16/src/parsedata.cpp:203:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf( def->data, "%s-%i", lel->data, prodNum++ );
data/kelbt-0.16/src/parsedata.cpp:236:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf( eofName, "%s_tk_eof", parserName );
data/kelbt-0.16/src/parsedata.h:350:8:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		if ( access != 0 )
data/kelbt-0.16/src/parsedata.h:351:10:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
			ret = access;
data/kelbt-0.16/src/parsedata.h:396:8:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	char *access;
data/kelbt-0.16/aapl/bubblesort.h:76: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 tmp[sizeof(T)];
data/kelbt-0.16/aapl/bubblesort.h:79:5:  [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( tmp, data+i, sizeof(T) );
data/kelbt-0.16/aapl/bubblesort.h:80:5:  [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( data+i, data+i+1, sizeof(T) );
data/kelbt-0.16/aapl/bubblesort.h:81:5:  [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( data+i+1, tmp, sizeof(T) );
data/kelbt-0.16/aapl/insertsort.h:82:4:  [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 tmp[sizeof(T)];
data/kelbt-0.16/aapl/insertsort.h:83:4:  [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( tmp, dest, sizeof(T) );
data/kelbt-0.16/aapl/insertsort.h:84:4:  [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( dest, smallest, sizeof(T) );
data/kelbt-0.16/aapl/insertsort.h:85:4:  [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( smallest, tmp, sizeof(T) );
data/kelbt-0.16/aapl/mergesort.h:102:5:  [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( dest, upper, (endUpper - upper) * sizeof(T) );
data/kelbt-0.16/aapl/mergesort.h:108:5:  [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( dest, lower, (endLower - lower) * sizeof(T) );
data/kelbt-0.16/aapl/mergesort.h:114:5:  [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( dest++, lower++, sizeof(T) );
data/kelbt-0.16/aapl/mergesort.h:116:5:  [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( dest++, upper++, sizeof(T) );
data/kelbt-0.16/aapl/mergesort.h:121: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( data, tmpStor, sizeof( T ) * len );
data/kelbt-0.16/aapl/quicksort.h:112: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 pcPivot[sizeof(T)];
data/kelbt-0.16/aapl/quicksort.h:115: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( pcPivot, pivot, sizeof(T) );
data/kelbt-0.16/aapl/quicksort.h:117: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( pivot, end, sizeof(T) );
data/kelbt-0.16/aapl/quicksort.h:132:5:  [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(last, first, sizeof(T));
data/kelbt-0.16/aapl/quicksort.h:143:5:  [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(first, last, sizeof(T));
data/kelbt-0.16/aapl/quicksort.h:150: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( first, pivot, sizeof(T) );
data/kelbt-0.16/src/buffer.h:41: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( data+length, p, l );
data/kelbt-0.16/src/codegen.cpp:71:12:  [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).
		rhsPos = atoi(data+1);
data/kelbt-0.16/src/klparse.cpp:1264:24:  [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).
		(__ref0)->priorVal = atoi( (__ref1)->data );
data/kelbt-0.16/src/klscan.cpp:130:11:  [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).
		inFile->open( *check );
data/kelbt-0.16/src/klscan.cpp:157:16:  [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.
		checks = new char *[2 + includePaths.length()];
data/kelbt-0.16/src/klscan.cpp:165:4:  [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( check, thisFileName, givenPathLen );
data/kelbt-0.16/src/klscan.cpp:166:4:  [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( check+givenPathLen, data, length );
data/kelbt-0.16/src/klscan.cpp:176:4:  [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( check, *incp, pathLen );
data/kelbt-0.16/src/klscan.cpp:178:4:  [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( check+pathLen+1, data, length );
data/kelbt-0.16/src/klscan.cpp:197: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( tokdata, start, len );
data/kelbt-0.16/src/klscan.cpp:514:4:  [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( newbuf, buf, have );
data/kelbt-0.16/src/main.cpp:329: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).
		outFilter->open( outputFile, ios::out|ios::trunc );
data/kelbt-0.16/src/parsedata.cpp:292: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).
				int refPos = atoi( ili->data+1 ) - 1;
data/kelbt-0.16/src/parsedata.cpp:1062:4:  [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[20];
data/kelbt-0.16/src/parsedata.cpp:1063:4:  [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.
			sprintf(name, "U%li", prodList.length());
data/kelbt-0.16/src/klscan.cpp:148:16:  [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).
	long length = strlen(fileName);
data/kelbt-0.16/src/klscan.cpp:173:19:  [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).
			long pathLen = strlen( *incp );
data/kelbt-0.16/src/klscan.cpp:519:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		input.read( p, space );
data/kelbt-0.16/src/main.cpp:92:32:  [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 *ppos = stemFile + strlen(stemFile) - 1;
data/kelbt-0.16/src/main.cpp:121: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).
	int len = strlen( stemFile );
data/kelbt-0.16/src/main.cpp:132: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).
	char *retVal = new char[ len + strlen( suffix ) + 1 ];
data/kelbt-0.16/src/main.cpp:133:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy( retVal, stemFile, len );
data/kelbt-0.16/src/parsedata.cpp:202:25:  [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).
			def->data = new char[strlen(lel->data) + 30];
data/kelbt-0.16/src/parsedata.cpp:235: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).
	char *eofName = new char[strlen(parserName) + 16];
data/kelbt-0.16/src/parsedata.h:93: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).
		inlineList->tail->data[strlen(inlineList->tail->data)-1] = 0;

ANALYSIS SUMMARY:

Hits = 51
Lines analyzed = 25665 in approximately 0.56 seconds (45481 lines/second)
Physical Source Lines of Code (SLOC) = 17633
Hits@level = [0]   0 [1]  10 [2]  34 [3]   0 [4]   7 [5]   0
Hits@level+ = [0+]  51 [1+]  51 [2+]  41 [3+]   7 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 2.8923 [1+] 2.8923 [2+] 2.32519 [3+] 0.396983 [4+] 0.396983 [5+]   0
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.