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/haxe-4.1.4/libs/extc/extc_stubs.c
Examining data/haxe-4.1.4/libs/extc/process_stubs.c
Examining data/haxe-4.1.4/libs/mbedtls/mbedtls_stubs.c
Examining data/haxe-4.1.4/libs/objsize/alloc.c
Examining data/haxe-4.1.4/libs/objsize/bitarray.c
Examining data/haxe-4.1.4/libs/objsize/c_objsize.c
Examining data/haxe-4.1.4/libs/objsize/util.h
Examining data/haxe-4.1.4/libs/pcre/pcre_stubs.c
Examining data/haxe-4.1.4/std/cpp/NativeXmlImport.cpp
Examining data/haxe-4.1.4/tests/misc/cppObjc/native/include/test.h
Examining data/haxe-4.1.4/tests/sys/src/ExitCode.c

FINAL RESULTS:

data/haxe-4.1.4/libs/extc/extc_stubs.c:394:15:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
	int length = readlink("/proc/self/exe", path, sizeof(path));
data/haxe-4.1.4/libs/extc/process_stubs.c:397:3:  [4] (shell) execvp:
  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.
		execvp(argv[0],argv);
data/haxe-4.1.4/libs/pcre/pcre_stubs.c:24:11:  [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 _snprintf
data/haxe-4.1.4/libs/pcre/pcre_stubs.c:24:20:  [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 _snprintf
data/haxe-4.1.4/libs/extc/extc_stubs.c:396: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.
		const char *p = getenv("_");
data/haxe-4.1.4/libs/extc/extc_stubs.c:415:6:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	if( realpath(String_val(f),path) == NULL )
data/haxe-4.1.4/libs/extc/process_stubs.c:273:13:  [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.
			cmdexe = getenv("COMSPEC");
data/haxe-4.1.4/libs/extc/process_stubs.c:344:8:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
		if( !CreateProcess(NULL,val_string(sargs),NULL,NULL,TRUE,0,NULL,NULL,&sinf,&p->pinf) ) {
data/haxe-4.1.4/libs/extc/process_stubs.c:344:8:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
		if( !CreateProcess(NULL,val_string(sargs),NULL,NULL,TRUE,0,NULL,NULL,&sinf,&p->pinf) ) {
data/haxe-4.1.4/libs/extc/extc_stubs.c:369: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 path[MAX_PATH];
data/haxe-4.1.4/libs/extc/extc_stubs.c:374: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 path[MAXPATHLEN+1];
data/haxe-4.1.4/libs/extc/extc_stubs.c:380: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 path[PATH_MAX];
data/haxe-4.1.4/libs/extc/extc_stubs.c:393: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 path[PATH_MAX];
data/haxe-4.1.4/libs/extc/extc_stubs.c:409: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 path[MAX_PATH];
data/haxe-4.1.4/libs/extc/extc_stubs.c:414: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 path[4096];
data/haxe-4.1.4/libs/extc/extc_stubs.c:427: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 out[MAX_PATH];
data/haxe-4.1.4/libs/extc/extc_stubs.c:467: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(out + last, data.cFileName, klen + 1);
data/haxe-4.1.4/libs/extc/process_stubs.c:106: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(it->str,s,len);
data/haxe-4.1.4/libs/extc/process_stubs.c:122: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(it->str + it->len,s,len);
data/haxe-4.1.4/libs/extc/process_stubs.c:126: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(it->str + it->len,s,free);
data/haxe-4.1.4/libs/extc/process_stubs.c:170: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(s,it->str,it->len);
data/haxe-4.1.4/libs/mbedtls/mbedtls_stubs.c:49: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[128];
data/haxe-4.1.4/libs/mbedtls/mbedtls_stubs.c:195: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(String_val(s), dat->p, dat->len);
data/haxe-4.1.4/libs/mbedtls/mbedtls_stubs.c:457: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(String_val(s), buf, len);
data/haxe-4.1.4/libs/mbedtls/mbedtls_stubs.c:468: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, String_val(s), len);
data/haxe-4.1.4/libs/objsize/alloc.c:26: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 msg[128];
data/haxe-4.1.4/libs/objsize/alloc.c:27: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
data/haxe-4.1.4/libs/objsize/c_objsize.c:54:21:  [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.
CAMLextern unsigned char * caml_page_table[Pagetable1_size];
data/haxe-4.1.4/libs/objsize/c_objsize.c:470:13:  [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* f = fopen("colors-dump", "w");
data/haxe-4.1.4/libs/pcre/pcre_stubs.c:497: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.
      char err_buf[100];
data/haxe-4.1.4/libs/pcre/pcre_stubs.c:582:7:  [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(subj, ocaml_subj, len);
data/haxe-4.1.4/tests/sys/src/ExitCode.c:6:10:  [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).
		return atoi(argv[1]);
data/haxe-4.1.4/libs/extc/extc_stubs.c:433:8:  [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).
	len = strlen(out);
data/haxe-4.1.4/libs/extc/extc_stubs.c:458: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).
			int klen = strlen(data.cFileName);
data/haxe-4.1.4/libs/extc/extc_stubs.c:549:6:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	c = getchar();
data/haxe-4.1.4/libs/extc/process_stubs.c:138:24:  [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).
	buffer_append_sub(b,s,strlen(s));
data/haxe-4.1.4/libs/extc/process_stubs.c:448:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	nbytes = read(p->oread,val_string(str)+val_int(pos),val_int(len));
data/haxe-4.1.4/libs/extc/process_stubs.c:479:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	nbytes = read(p->eread,val_string(str)+val_int(pos),val_int(len));

ANALYSIS SUMMARY:

Hits = 38
Lines analyzed = 3638 in approximately 0.90 seconds (4062 lines/second)
Physical Source Lines of Code (SLOC) = 2728
Hits@level = [0]  15 [1]   6 [2]  23 [3]   5 [4]   3 [5]   1
Hits@level+ = [0+]  53 [1+]  38 [2+]  32 [3+]   9 [4+]   4 [5+]   1
Hits/KSLOC@level+ = [0+] 19.4282 [1+] 13.9296 [2+] 11.7302 [3+] 3.29912 [4+] 1.46628 [5+] 0.366569
Dot directories skipped = 10 (--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.