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/pyethash-0.1.27/src/libethash/compiler.h
Examining data/pyethash-0.1.27/src/libethash/data_sizes.h
Examining data/pyethash-0.1.27/src/libethash/endian.h
Examining data/pyethash-0.1.27/src/libethash/ethash.h
Examining data/pyethash-0.1.27/src/libethash/fnv.h
Examining data/pyethash-0.1.27/src/libethash/internal.c
Examining data/pyethash-0.1.27/src/libethash/internal.h
Examining data/pyethash-0.1.27/src/libethash/io.c
Examining data/pyethash-0.1.27/src/libethash/io.h
Examining data/pyethash-0.1.27/src/libethash/io_posix.c
Examining data/pyethash-0.1.27/src/libethash/mmap.h
Examining data/pyethash-0.1.27/src/libethash/sha3.c
Examining data/pyethash-0.1.27/src/libethash/sha3.h
Examining data/pyethash-0.1.27/src/libethash/sha3_cryptopp.cpp
Examining data/pyethash-0.1.27/src/libethash/sha3_cryptopp.h
Examining data/pyethash-0.1.27/src/libethash/util.h
Examining data/pyethash-0.1.27/src/python/core.c

FINAL RESULTS:

data/pyethash-0.1.27/src/libethash/io.h:54:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf(...) sprintf_s(__VA_ARGS__)
data/pyethash-0.1.27/src/libethash/io.h:66:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		printf("ETHASH CRITICAL ERROR: "__VA_ARGS__);	\
data/pyethash-0.1.27/src/libethash/io.h:197:12:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "full-R%u-%016" PRIx64, revision, hash) >= 0;
data/pyethash-0.1.27/src/libethash/util.h:32:16:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define debugf printf
data/pyethash-0.1.27/src/libethash/io_posix.c:93:19:  [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.
	char* home_dir = getenv("HOME");
data/pyethash-0.1.27/src/libethash/internal.c:102: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(ret, init, sizeof(node));
data/pyethash-0.1.27/src/libethash/internal.c:190: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(s_mix[0].bytes, &header_hash, 32);
data/pyethash-0.1.27/src/libethash/internal.c:251: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(&ret->mix_hash, mix->bytes, 32);
data/pyethash-0.1.27/src/libethash/internal.c:265: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(buf, header_hash, 32);
data/pyethash-0.1.27/src/libethash/internal.c:267: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(&(buf[32]), &nonce, 8);
data/pyethash-0.1.27/src/libethash/internal.c:269: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(&(buf[64]), mix_hash, 32);
data/pyethash-0.1.27/src/libethash/internal.c:460: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 strbuf[256];
data/pyethash-0.1.27/src/libethash/io.c:34: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 mutable_name[DAG_MUTABLE_NAME_MAX_SIZE];
data/pyethash-0.1.27/src/libethash/io.c:47:7:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
	if (!tmpfile) {
data/pyethash-0.1.27/src/libethash/io.c:55:20:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
		f = ethash_fopen(tmpfile, "rb+");
data/pyethash-0.1.27/src/libethash/io.c:60:65:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
				ETHASH_CRITICAL("Could not query size of DAG file: \"%s\"", tmpfile);
data/pyethash-0.1.27/src/libethash/io.c:73:61:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
				ETHASH_CRITICAL("Could not read from DAG file: \"%s\"", tmpfile);
data/pyethash-0.1.27/src/libethash/io.c:88:19:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
	f = ethash_fopen(tmpfile, "wb+");
data/pyethash-0.1.27/src/libethash/io.c:90:56:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
		ETHASH_CRITICAL("Could not create DAG file: \"%s\"", tmpfile);
data/pyethash-0.1.27/src/libethash/io.c:96:89:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
		ETHASH_CRITICAL("Could not seek to the end of DAG file: \"%s\". Insufficient space?", tmpfile);
data/pyethash-0.1.27/src/libethash/io.c:101:90:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
		ETHASH_CRITICAL("Could not write in the end of DAG file: \"%s\". Insufficient space?", tmpfile);
data/pyethash-0.1.27/src/libethash/io.c:106:86:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
		ETHASH_CRITICAL("Could not flush at end of DAG file: \"%s\". Insufficient space?", tmpfile);
data/pyethash-0.1.27/src/libethash/io.c:116:7:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
	free(tmpfile);
data/pyethash-0.1.27/src/libethash/io_posix.c:34:9:  [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).
	return fopen(file_name, mode);
data/pyethash-0.1.27/src/python/core.c:80: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 error_message[1024];
data/pyethash-0.1.27/src/python/core.c:81: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.
        sprintf(error_message, "Seed must be 32 bytes long (was %i)", header_size);
data/pyethash-0.1.27/src/python/core.c:192: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 error_message[1024];
data/pyethash-0.1.27/src/python/core.c:193: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.
        sprintf(error_message, "Block number must be less than %i (was %lu)", ETHASH_EPOCH_LENGTH * 2048, block_number);
data/pyethash-0.1.27/src/libethash/io.c:46:67:  [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* tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name));
data/pyethash-0.1.27/src/libethash/io_posix.c:39:9:  [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 strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL;
data/pyethash-0.1.27/src/libethash/io_posix.c:39:49:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL;
data/pyethash-0.1.27/src/libethash/io_posix.c:59: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).
	size_t dirlen = strlen(dirname);
data/pyethash-0.1.27/src/libethash/io_posix.c:94: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).
	if (!home_dir || strlen(home_dir) == 0)
data/pyethash-0.1.27/src/libethash/io_posix.c:101:15:  [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).
	size_t len = strlen(home_dir);

ANALYSIS SUMMARY:

Hits = 34
Lines analyzed = 2830 in approximately 0.12 seconds (22814 lines/second)
Physical Source Lines of Code (SLOC) = 1981
Hits@level = [0]   2 [1]   6 [2]  23 [3]   1 [4]   4 [5]   0
Hits@level+ = [0+]  36 [1+]  34 [2+]  28 [3+]   5 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 18.1726 [1+] 17.163 [2+] 14.1343 [3+] 2.52398 [4+] 2.01918 [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.