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/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp
Examining data/concurrentqueue-1.0.2+ds/benchmarks/boostqueue.h
Examining data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp
Examining data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.h
Examining data/concurrentqueue-1.0.2+ds/benchmarks/lockbasedqueue.h
Examining data/concurrentqueue-1.0.2+ds/benchmarks/simplelockfree.h
Examining data/concurrentqueue-1.0.2+ds/benchmarks/stdqueue.h
Examining data/concurrentqueue-1.0.2+ds/benchmarks/tbbqueue.h
Examining data/concurrentqueue-1.0.2+ds/benchmarks/wrappers.h
Examining data/concurrentqueue-1.0.2+ds/blockingconcurrentqueue.h
Examining data/concurrentqueue-1.0.2+ds/build/msvc12/msvc_tbb_stubs.cpp
Examining data/concurrentqueue-1.0.2+ds/build/msvc14/msvc_tbb_stubs.cpp
Examining data/concurrentqueue-1.0.2+ds/build/msvc15/msvc_tbb_stubs.cpp
Examining data/concurrentqueue-1.0.2+ds/build/msvc16/msvc_tbb_stubs.cpp
Examining data/concurrentqueue-1.0.2+ds/concurrentqueue.h
Examining data/concurrentqueue-1.0.2+ds/internal/concurrentqueue_internal_debug.h
Examining data/concurrentqueue-1.0.2+ds/lightweightsemaphore.h
Examining data/concurrentqueue-1.0.2+ds/tests/CDSChecker/corealgo.h
Examining data/concurrentqueue-1.0.2+ds/tests/CDSChecker/enqueue_dequeue_many.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/CDSChecker/enqueue_dequeue_one.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/common/simplethread.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/common/simplethread.h
Examining data/concurrentqueue-1.0.2+ds/tests/common/systemtime.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/common/systemtime.h
Examining data/concurrentqueue-1.0.2+ds/tests/corealgos.h
Examining data/concurrentqueue-1.0.2+ds/tests/fuzztests/fuzztests.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/relacy/freelist.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/relacy/integrated.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/relacy/relacy_shims.h
Examining data/concurrentqueue-1.0.2+ds/tests/relacy/spmchash.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/unittests/mallocmacro.cpp
Examining data/concurrentqueue-1.0.2+ds/tests/unittests/minitest.h
Examining data/concurrentqueue-1.0.2+ds/tests/unittests/unittests.cpp
Examining data/concurrentqueue-1.0.2+ds/debian/tests/test1.cpp
Examining data/concurrentqueue-1.0.2+ds/debian/tests/test2.cpp
Examining data/concurrentqueue-1.0.2+ds/debian/tests/test3.cpp

FINAL RESULTS:

data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1648:2:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
	vsprintf(buf, fmt, arglist);
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1671: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(buf, std::asctime(std::localtime(&time)));
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:166:4:  [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(buf, UNKNOWN_CPU_STRING);
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:207:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		std::sprintf(str, " with %d core%s%s @ %.1fGHz%s", cores, cores == 1 ? "" : "s", ht ? " (HyperThreaded)" : "", clockSpeed, cpus > 1 ? " each" : "");
data/concurrentqueue-1.0.2+ds/tests/fuzztests/fuzztests.cpp:637: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(buf, std::asctime(std::localtime(&time)));
data/concurrentqueue-1.0.2+ds/tests/fuzztests/fuzztests.cpp:854:11:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
					std::sprintf(ptr, "    %s: %llu successful, %llu failed\n", test_names[i], (unsigned long long)(test_count[i] - fail_count[i]), (unsigned long long)fail_count[i]);
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1876:7:  [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.
	std::srand(std::time(NULL));
data/concurrentqueue-1.0.2+ds/internal/concurrentqueue_internal_debug.h:17:17:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
		void lock() { EnterCriticalSection(&cs); }
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:66: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.
const char BENCHMARK_SHORT_NAMES[BENCHMARK_TYPE_COUNT][32] = {
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:86: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.
const char BENCHMARK_NAMES[BENCHMARK_TYPE_COUNT][64] = {
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:106: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.
const char BENCHMARK_DESCS[BENCHMARK_TYPE_COUNT][256] = {
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp: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.
const char BENCHMARK_SINGLE_THREAD_NOTES[BENCHMARK_TYPE_COUNT][256] = {
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:199: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.
const char QUEUE_NAMES[QUEUE_COUNT][64] = {
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:209: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.
const char QUEUE_SUMMARY_NOTES[QUEUE_COUNT][128] = {
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1642: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.
	static char buf[2048];
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1669: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.
	static char buf[32];
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1716: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.
	static char bufs[16][8];
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1728:3:  [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(buf, "%1.4f%c", num, minisufs[suffix]);
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1736:3:  [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(buf, "%.2f%c", num, megasufs[suffix]);
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:154: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[128] = { 0 };
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:203:9:  [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(str, " x%d", cpus);
data/concurrentqueue-1.0.2+ds/benchmarks/simplelockfree.h:156: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 rawItem[sizeof(T)];
data/concurrentqueue-1.0.2+ds/benchmarks/simplelockfree.h:176: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 nodes[sizeof(Node) * BLOCK_SIZE];
data/concurrentqueue-1.0.2+ds/tests/fuzztests/fuzztests.cpp:635: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.
	static char buf[32];
data/concurrentqueue-1.0.2+ds/tests/fuzztests/fuzztests.cpp:851: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 breakdown[128 * TEST_TYPE_COUNT];
data/concurrentqueue-1.0.2+ds/tests/unittests/unittests.cpp:4900:28:  [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.
		union Elem { uint32_t x; char dummy[156]; };
data/concurrentqueue-1.0.2+ds/tests/unittests/unittests.cpp:5005:49:  [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).
				iterations = static_cast<unsigned int>(std::atoi(argv[++i]));
data/concurrentqueue-1.0.2+ds/benchmarks/benchmarks.cpp:1672:6:  [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).
	buf[strlen(buf) - 1] = '\0';	// Remove trailing newline
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:186:28:  [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).
		for (atIndex = (int)std::strlen(buf) - 1; atIndex != -1; --atIndex) {
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:196: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).
		for (char* s = buf + std::strlen(buf); s != buf && s[-1] == ' '; --s)
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:198: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* str = buf + std::strlen(buf);
data/concurrentqueue-1.0.2+ds/benchmarks/cpuid.cpp:204:11:  [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).
			str += strlen(str);
data/concurrentqueue-1.0.2+ds/tests/common/systemtime.cpp:78:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
	::usleep(milliseconds * 1000);
data/concurrentqueue-1.0.2+ds/tests/common/systemtime.cpp:114:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
	::usleep(milliseconds * 1000);
data/concurrentqueue-1.0.2+ds/tests/fuzztests/fuzztests.cpp:638:6:  [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).
	buf[strlen(buf) - 1] = '\0';	// Remove trailing newline
data/concurrentqueue-1.0.2+ds/tests/fuzztests/fuzztests.cpp:855: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).
					ptr += std::strlen(ptr);
data/concurrentqueue-1.0.2+ds/tests/unittests/unittests.cpp:5048:3:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		getchar();

ANALYSIS SUMMARY:

Hits = 37
Lines analyzed = 16577 in approximately 0.42 seconds (39911 lines/second)
Physical Source Lines of Code (SLOC) = 13142
Hits@level = [0]  52 [1]  10 [2]  19 [3]   2 [4]   6 [5]   0
Hits@level+ = [0+]  89 [1+]  37 [2+]  27 [3+]   8 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 6.77218 [1+] 2.8154 [2+] 2.05448 [3+] 0.608735 [4+] 0.456552 [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.