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/premake4-4.3+repack1/src/host/os_mkdir.c
Examining data/premake4-4.3+repack1/src/host/os_isfile.c
Examining data/premake4-4.3+repack1/src/host/os_uuid.c
Examining data/premake4-4.3+repack1/src/host/os_isdir.c
Examining data/premake4-4.3+repack1/src/host/string_endswith.c
Examining data/premake4-4.3+repack1/src/host/os_getcwd.c
Examining data/premake4-4.3+repack1/src/host/path_isabsolute.c
Examining data/premake4-4.3+repack1/src/host/premake.c
Examining data/premake4-4.3+repack1/src/host/os_rmdir.c
Examining data/premake4-4.3+repack1/src/host/os_pathsearch.c
Examining data/premake4-4.3+repack1/src/host/os_chdir.c
Examining data/premake4-4.3+repack1/src/host/os_copyfile.c
Examining data/premake4-4.3+repack1/src/host/os_match.c
Examining data/premake4-4.3+repack1/src/host/premake.h
Examining data/premake4-4.3+repack1/src/host/scripts.c

FINAL RESULTS:

data/premake4-4.3+repack1/src/host/os_copyfile.c:20:7:  [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.
	z = (system(lua_tostring(L, -1)) == 0);
data/premake4-4.3+repack1/src/host/os_match.c:110:3:  [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(m->mask, split + 1);
data/premake4-4.3+repack1/src/host/os_match.c:117:3:  [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(m->mask, mask);
data/premake4-4.3+repack1/src/host/premake.c:174:3:  [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(key, arg);
data/premake4-4.3+repack1/src/host/premake.c:212: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(ERROR_MESSAGE, 
data/premake4-4.3+repack1/src/host/premake.c:224: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(ERROR_MESSAGE, lua_tostring(L, -1));
data/premake4-4.3+repack1/src/host/premake.c:233: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(ERROR_MESSAGE, lua_tostring(L, -1));
data/premake4-4.3+repack1/src/host/premake.c:257:4:  [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(ERROR_MESSAGE, lua_tostring(L, -1));
data/premake4-4.3+repack1/src/host/premake.c:266: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(ERROR_MESSAGE, lua_tostring(L,-1));
data/premake4-4.3+repack1/src/host/os_uuid.c:20:21:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
		HMODULE hOleDll = LoadLibrary("OLE32.DLL");
data/premake4-4.3+repack1/src/host/premake.c:207:20:  [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.
	lua_pushstring(L, getenv("PREMAKE_PATH"));
data/premake4-4.3+repack1/src/host/os_getcwd.c:11: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 buffer[0x4000];
data/premake4-4.3+repack1/src/host/os_uuid.c:12:11:  [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.
	unsigned char bytes[16];
data/premake4-4.3+repack1/src/host/os_uuid.c:13: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 uuid[38];
data/premake4-4.3+repack1/src/host/os_uuid.c:29:14:  [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* rnd = fopen("/dev/urandom", "rb");
data/premake4-4.3+repack1/src/host/os_uuid.c:36:2:  [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(uuid, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
data/premake4-4.3+repack1/src/host/premake.c:159: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 key[512];
data/premake4-4.3+repack1/src/host/os_isdir.c:18: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).
	if (strlen(path) == 0)
data/premake4-4.3+repack1/src/host/os_match.c:107:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(m->path, mask, split - mask);
data/premake4-4.3+repack1/src/host/os_match.c:109:34:  [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).
		m->mask = (char*)malloc(mask + strlen(mask) - split);
data/premake4-4.3+repack1/src/host/os_match.c:115:3:  [1] (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). Risk is low because the source is a constant character.
		strcpy(m->path, ".");
data/premake4-4.3+repack1/src/host/os_match.c:116: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).
		m->mask = (char*)malloc(strlen(mask)+1);
data/premake4-4.3+repack1/src/host/premake.c:168:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(key, arg, len);
data/premake4-4.3+repack1/src/host/premake.c:183:37:  [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 (strcmp(key, "scripts") == 0 && strlen(value) > 0)
data/premake4-4.3+repack1/src/host/string_endswith.c:18:14:  [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 hlen = strlen(haystack);
data/premake4-4.3+repack1/src/host/string_endswith.c:19:14:  [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 nlen = strlen(needle);

ANALYSIS SUMMARY:

Hits = 26
Lines analyzed = 1225 in approximately 0.25 seconds (4866 lines/second)
Physical Source Lines of Code (SLOC) = 832
Hits@level = [0]   1 [1]   9 [2]   6 [3]   2 [4]   9 [5]   0
Hits@level+ = [0+]  27 [1+]  26 [2+]  17 [3+]  11 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 32.4519 [1+] 31.25 [2+] 20.4327 [3+] 13.2212 [4+] 10.8173 [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.