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/bam-0.5.1/examples/plugin/hello.c
Examining data/bam-0.5.1/src/cache.c
Examining data/bam-0.5.1/src/cache.h
Examining data/bam-0.5.1/src/context.c
Examining data/bam-0.5.1/src/context.h
Examining data/bam-0.5.1/src/dep_cpp.c
Examining data/bam-0.5.1/src/dep_search.c
Examining data/bam-0.5.1/src/lua/lapi.c
Examining data/bam-0.5.1/src/lua/lapi.h
Examining data/bam-0.5.1/src/lua/lauxlib.c
Examining data/bam-0.5.1/src/lua/lauxlib.h
Examining data/bam-0.5.1/src/lua/lbaselib.c
Examining data/bam-0.5.1/src/lua/lbitlib.c
Examining data/bam-0.5.1/src/lua/lcode.c
Examining data/bam-0.5.1/src/lua/lcode.h
Examining data/bam-0.5.1/src/lua/lcorolib.c
Examining data/bam-0.5.1/src/lua/lctype.c
Examining data/bam-0.5.1/src/lua/lctype.h
Examining data/bam-0.5.1/src/lua/ldblib.c
Examining data/bam-0.5.1/src/lua/ldebug.c
Examining data/bam-0.5.1/src/lua/ldebug.h
Examining data/bam-0.5.1/src/lua/ldo.c
Examining data/bam-0.5.1/src/lua/ldo.h
Examining data/bam-0.5.1/src/lua/ldump.c
Examining data/bam-0.5.1/src/lua/lfunc.c
Examining data/bam-0.5.1/src/lua/lfunc.h
Examining data/bam-0.5.1/src/lua/lgc.c
Examining data/bam-0.5.1/src/lua/lgc.h
Examining data/bam-0.5.1/src/lua/linit.c
Examining data/bam-0.5.1/src/lua/liolib.c
Examining data/bam-0.5.1/src/lua/llex.c
Examining data/bam-0.5.1/src/lua/llex.h
Examining data/bam-0.5.1/src/lua/llimits.h
Examining data/bam-0.5.1/src/lua/lmathlib.c
Examining data/bam-0.5.1/src/lua/lmem.c
Examining data/bam-0.5.1/src/lua/lmem.h
Examining data/bam-0.5.1/src/lua/loadlib.c
Examining data/bam-0.5.1/src/lua/lobject.c
Examining data/bam-0.5.1/src/lua/lobject.h
Examining data/bam-0.5.1/src/lua/lopcodes.c
Examining data/bam-0.5.1/src/lua/lopcodes.h
Examining data/bam-0.5.1/src/lua/loslib.c
Examining data/bam-0.5.1/src/lua/lparser.c
Examining data/bam-0.5.1/src/lua/lparser.h
Examining data/bam-0.5.1/src/lua/lprefix.h
Examining data/bam-0.5.1/src/lua/lstate.c
Examining data/bam-0.5.1/src/lua/lstate.h
Examining data/bam-0.5.1/src/lua/lstring.c
Examining data/bam-0.5.1/src/lua/lstring.h
Examining data/bam-0.5.1/src/lua/lstrlib.c
Examining data/bam-0.5.1/src/lua/ltable.c
Examining data/bam-0.5.1/src/lua/ltable.h
Examining data/bam-0.5.1/src/lua/ltablib.c
Examining data/bam-0.5.1/src/lua/ltm.c
Examining data/bam-0.5.1/src/lua/ltm.h
Examining data/bam-0.5.1/src/lua/lua.h
Examining data/bam-0.5.1/src/lua/lua.hpp
Examining data/bam-0.5.1/src/lua/luaconf.h
Examining data/bam-0.5.1/src/lua/lualib.h
Examining data/bam-0.5.1/src/lua/lundump.c
Examining data/bam-0.5.1/src/lua/lundump.h
Examining data/bam-0.5.1/src/lua/lutf8lib.c
Examining data/bam-0.5.1/src/lua/lvm.c
Examining data/bam-0.5.1/src/lua/lvm.h
Examining data/bam-0.5.1/src/lua/lzio.c
Examining data/bam-0.5.1/src/lua/lzio.h
Examining data/bam-0.5.1/src/luafuncs.c
Examining data/bam-0.5.1/src/luafuncs.h
Examining data/bam-0.5.1/src/main.c
Examining data/bam-0.5.1/src/mem.c
Examining data/bam-0.5.1/src/mem.h
Examining data/bam-0.5.1/src/node.c
Examining data/bam-0.5.1/src/node.h
Examining data/bam-0.5.1/src/path.c
Examining data/bam-0.5.1/src/path.h
Examining data/bam-0.5.1/src/platform.h
Examining data/bam-0.5.1/src/session.h
Examining data/bam-0.5.1/src/support.c
Examining data/bam-0.5.1/src/support.h
Examining data/bam-0.5.1/src/tools/txt2c.c
Examining data/bam-0.5.1/src/tree.h
Examining data/bam-0.5.1/src/version.h
Examining data/bam-0.5.1/tests/collect_recurse/collect_recurse.cpp
Examining data/bam-0.5.1/tests/collect_recurse/extra/recursed.cpp
Examining data/bam-0.5.1/tests/collect_wrong/collect_wrong.cpp
Examining data/bam-0.5.1/tests/cxx_dep/dir/system_header.h
Examining data/bam-0.5.1/tests/cxx_dep/lib.c
Examining data/bam-0.5.1/tests/cxx_dep/local_header.h
Examining data/bam-0.5.1/tests/cxx_dep/main.c
Examining data/bam-0.5.1/tests/cyclic/cyclic.c
Examining data/bam-0.5.1/tests/cyclic/header1.h
Examining data/bam-0.5.1/tests/cyclic/header2.h
Examining data/bam-0.5.1/tests/deadlock/header1.h
Examining data/bam-0.5.1/tests/deadlock/header2.h
Examining data/bam-0.5.1/tests/deadlock/test.c
Examining data/bam-0.5.1/tests/deps/main.c
Examining data/bam-0.5.1/tests/dot.in.dir/dot_in_dir.cpp
Examining data/bam-0.5.1/tests/include_paths/dir/system_header.h
Examining data/bam-0.5.1/tests/include_paths/include_paths.c
Examining data/bam-0.5.1/tests/include_paths/local_header.h
Examining data/bam-0.5.1/tests/locked/locked.cpp
Examining data/bam-0.5.1/tests/multi_target/multi_target.c
Examining data/bam-0.5.1/tests/retval/retval.cpp
Examining data/bam-0.5.1/tests/sharedlib/sharedlib.cpp
Examining data/bam-0.5.1/tests/subproject/main.c
Examining data/bam-0.5.1/tests/subproject/mod/mod.c
Examining data/bam-0.5.1/tests/subproject/mod/mod.h

FINAL RESULTS:

data/bam-0.5.1/src/context.c:132:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(buf, "\033[01;32m[%%%dd/%%%dd] \033[01;36m[%%%dd]\033[00m %%s\n", jobdigits, jobdigits, threaddigits);
data/bam-0.5.1/src/context.c:134:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(buf, "[%%%dd/%%%dd] [%%%dd] %%s\n", jobdigits, jobdigits, threaddigits);
data/bam-0.5.1/src/context.c:145: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(format, context->current_job_num, context->num_jobs, thread_id, job->label);
data/bam-0.5.1/src/dep_cpp.c:295:5:  [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, filename);
data/bam-0.5.1/src/lua/lauxlib.h:226:10:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        (fprintf(stderr, (s), (p)), fflush(stderr))
data/bam-0.5.1/src/lua/liolib.c:58:40:  [4] (shell) popen:
  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.
#define l_popen(L,c,m)		(fflush(NULL), popen(c,m))
data/bam-0.5.1/src/lua/liolib.c:621:19:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                ? fprintf(f, LUA_INTEGER_FMT, lua_tointeger(L, arg))
data/bam-0.5.1/src/lua/liolib.c:622:19:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                : fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg));
data/bam-0.5.1/src/lua/lobject.c:286:5:  [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(buff, s);  /* copy string to buffer */
data/bam-0.5.1/src/lua/loslib.c:122:9:  [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(b, LUA_TMPNAMTEMPLATE); \
data/bam-0.5.1/src/lua/loslib.c:143:14:  [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.
  int stat = system(cmd);
data/bam-0.5.1/src/lua/lstrlib.c:1009: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(form + l - 1, lenmod);
data/bam-0.5.1/src/lua/luaconf.h:591:29:  [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 l_sprintf(s,sz,f,i)	snprintf(s,sz,f,i)
data/bam-0.5.1/src/lua/luaconf.h:593:42:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
#define l_sprintf(s,sz,f,i)	((void)(sz), sprintf(s,f,i))
data/bam-0.5.1/src/luafuncs.c:937: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(recursepath, filename);
data/bam-0.5.1/src/luafuncs.c:939:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
		strcat(recursepath, info->start_str);
data/bam-0.5.1/src/luafuncs.c:1061: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(buffer, path);
data/bam-0.5.1/src/main.c:764:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(depcache_filename, ".bam/%s", hashstr);
data/bam-0.5.1/src/support.c:39: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(buffer, path);
data/bam-0.5.1/src/support.c:57: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(startpoint, finddata.cFileName);
data/bam-0.5.1/src/support.c:323: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(buffer, path);
data/bam-0.5.1/src/support.c:335: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(startpoint, entry->d_name);
data/bam-0.5.1/src/support.c:659:8:  [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.
	ret = system(cmd);
data/bam-0.5.1/src/lua/lmathlib.c:28:18:  [3] (random) random:
  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.
#define l_rand()	random()
data/bam-0.5.1/src/lua/lmathlib.c:29:20:  [3] (random) srandom:
  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.
#define l_srand(x)	srandom(x)
data/bam-0.5.1/src/lua/lmathlib.c:33:20:  [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.
#define l_srand(x)	srand(x)
data/bam-0.5.1/src/lua/loadlib.c:687:22:  [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 *path = getenv(envname1);
data/bam-0.5.1/src/lua/loadlib.c:689:12:  [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.
    path = getenv(envname2);  /* try alternative name */
data/bam-0.5.1/src/lua/loslib.c:131:33:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
#define lua_tmpnam(b,e)		{ e = (tmpnam(b) == NULL); }
data/bam-0.5.1/src/lua/loslib.c:178:21:  [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(luaL_checkstring(L, 1)));  /* if NULL push nil */
data/bam-0.5.1/src/main.c:1048:5:  [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.
	if(getenv("BAM_OPTIONS"))
data/bam-0.5.1/src/main.c:1050:27:  [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.
		if(parse_parameters_str(getenv("BAM_OPTIONS")))
data/bam-0.5.1/src/support.c:186:9:  [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(
data/bam-0.5.1/src/support.c:186:9:  [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(
data/bam-0.5.1/src/support.c:212:3:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
		InitializeCriticalSection(&criticalsection);
data/bam-0.5.1/src/support.c:223:33:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
	void criticalsection_enter() { EnterCriticalSection(&criticalsection); }
data/bam-0.5.1/src/cache.c:23:8:  [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 bamheader[24] = {
data/bam-0.5.1/src/cache.c:38:38:  [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 void cache_setup_header(const char type[4])
data/bam-0.5.1/src/cache.c:41: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(&bamheader[4], type, 3);
data/bam-0.5.1/src/cache.c:42: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(&bamheader[8], BAM_VERSION_STRING_COMPLETE, sizeof(BAM_VERSION_STRING_COMPLETE));
data/bam-0.5.1/src/cache.c:66:33:  [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).
	#define io_open_read(filename) open(filename, O_RDONLY)
data/bam-0.5.1/src/cache.c:67:34:  [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).
	#define io_open_write(filename) open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666)
data/bam-0.5.1/src/cache.c:89:33:  [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).
	#define io_open_read(filename) fopen(filename, "rb")
data/bam-0.5.1/src/cache.c:90:34:  [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).
	#define io_open_write(filename) fopen(filename, "wb")
data/bam-0.5.1/src/cache.c:157: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 header[sizeof(bamheader)];
data/bam-0.5.1/src/cache.c:178: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 strings[WRITE_BUFFERSIZE];
data/bam-0.5.1/src/cache.c:273: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(info->buffers.strings + info->index, node->filename, node->filename_len);
data/bam-0.5.1/src/context.c:121: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[64];
data/bam-0.5.1/src/context.h:20: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 script_directory[512];
data/bam-0.5.1/src/dep_cpp.c:176: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).
	file = fopen(node->filename, "rb");
data/bam-0.5.1/src/dep_cpp.c:259: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[MAX_PATH_LENGTH];
data/bam-0.5.1/src/dep_search.c:56: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[MAX_PATH_LENGTH];
data/bam-0.5.1/src/lua/lapi.c:1294:33:  [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).
  if (upisopen(*up1)) (*up1)->u.open.touched = 1;
data/bam-0.5.1/src/lua/lauxlib.c:520: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(newbuff, B->b, B->n * sizeof(char));  /* copy original content */
data/bam-0.5.1/src/lua/lauxlib.c:532: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(b, s, l * sizeof(char));
data/bam-0.5.1/src/lua/lauxlib.c:639: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 buff[BUFSIZ];  /* area for reading file */
data/bam-0.5.1/src/lua/lauxlib.c:716:12:  [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).
    lf.f = fopen(filename, "r");
data/bam-0.5.1/src/lua/lauxlib.h:145: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 initb[LUAL_BUFFERSIZE];  /* initial buffer */
data/bam-0.5.1/src/lua/ldblib.c:382: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 buff[5];
data/bam-0.5.1/src/lua/ldblib.c:404: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 buffer[250];
data/bam-0.5.1/src/lua/ldebug.c:611: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 buff[LUA_IDSIZE];
data/bam-0.5.1/src/lua/ldo.c:162:50:  [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).
  for (up = L->openupval; up != NULL; up = up->u.open.next)
data/bam-0.5.1/src/lua/lfunc.c:66:16:  [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).
    pp = &p->u.open.next;
data/bam-0.5.1/src/lua/lfunc.c:71:9:  [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).
  uv->u.open.next = *pp;  /* link it to list of open upvalues */
data/bam-0.5.1/src/lua/lfunc.c:72:9:  [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).
  uv->u.open.touched = 1;
data/bam-0.5.1/src/lua/lfunc.c:87:26:  [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).
    L->openupval = uv->u.open.next;  /* remove from 'open' list */
data/bam-0.5.1/src/lua/lfunc.h:42:7:  [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).
    } open;
data/bam-0.5.1/src/lua/lgc.c:323:59:  [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).
      for (uv = thread->openupval; uv != NULL; uv = uv->u.open.next) {
data/bam-0.5.1/src/lua/lgc.c:324:19:  [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).
        if (uv->u.open.touched) {
data/bam-0.5.1/src/lua/lgc.c:326:17:  [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).
          uv->u.open.touched = 0;
data/bam-0.5.1/src/lua/lgc.c:521:15:  [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).
        uv->u.open.touched = 1;  /* can be marked in 'remarkupvals' */
data/bam-0.5.1/src/lua/liolib.c:244:10:  [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).
  p->f = fopen(fname, mode);
data/bam-0.5.1/src/lua/liolib.c:256:10:  [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).
  p->f = fopen(filename, mode);
data/bam-0.5.1/src/lua/liolib.c:282:10:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  p->f = tmpfile();
data/bam-0.5.1/src/lua/liolib.c:388: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 buff[L_MAXLENNUM + 1];  /* +1 for ending '\0' */
data/bam-0.5.1/src/lua/liolib.c:438: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 decp[2];
data/bam-0.5.1/src/lua/llex.c:346: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 buff[UTF8BUFFSZ];
data/bam-0.5.1/src/lua/loadlib.c:193: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 buff[MAX_PATH + 1];
data/bam-0.5.1/src/lua/loadlib.c:209: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 buffer[128];
data/bam-0.5.1/src/lua/loadlib.c:378: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(filename, "r");  /* try to open file */
data/bam-0.5.1/src/lua/lobject.c:282: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 buff[L_MAXLENNUM + 1];
data/bam-0.5.1/src/lua/lobject.c:372: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 buff[MAXNUMBER2STR];
data/bam-0.5.1/src/lua/lobject.c:437: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 buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */
data/bam-0.5.1/src/lua/lobject.c:443: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 buff[UTF8BUFFSZ];
data/bam-0.5.1/src/lua/lobject.c:484:25:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define addstr(a,b,l)	( memcpy(a,b,(l) * sizeof(char)), a += (l) )
data/bam-0.5.1/src/lua/lobject.c:490: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(out, source + 1, l * sizeof(char));
data/bam-0.5.1/src/lua/lobject.c:498: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(out, source + 1, l * sizeof(char));
data/bam-0.5.1/src/lua/lobject.c:502: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(out, source + 1 + l - bufflen, bufflen * sizeof(char));
data/bam-0.5.1/src/lua/lobject.c:518: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(out, POS, (LL(POS) + 1) * sizeof(char));
data/bam-0.5.1/src/lua/lopcodes.c:20:17:  [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.
LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
data/bam-0.5.1/src/lua/lopcodes.h:288:17:  [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.
LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1];  /* opcode names */
data/bam-0.5.1/src/lua/loslib.c:123:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
        e = mkstemp(b); \
data/bam-0.5.1/src/lua/loslib.c:167: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 buff[LUA_TMPNAMBUFSIZE];
data/bam-0.5.1/src/lua/loslib.c:267: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(buff, conv, oplen);  /* copy valid option to buffer */
data/bam-0.5.1/src/lua/loslib.c:299: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 cc[4];  /* buffer for individual conversion specifiers */
data/bam-0.5.1/src/lua/lstate.c: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(b + p, &t, sizeof(t)); p += sizeof(t); }
data/bam-0.5.1/src/lua/lstate.c:82: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 buff[4 * sizeof(size_t)];
data/bam-0.5.1/src/lua/lstate.c:276: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(lua_getextraspace(L1), lua_getextraspace(g->mainthread),
data/bam-0.5.1/src/lua/lstring.c:187: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(getstr(ts), str, l * sizeof(char));
data/bam-0.5.1/src/lua/lstring.c:207: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(getstr(ts), str, l * sizeof(char));
data/bam-0.5.1/src/lua/lstrlib.c:135: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(p, s, l * sizeof(char)); p += l;
data/bam-0.5.1/src/lua/lstrlib.c:137:9:  [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(p, sep, lsep * sizeof(char));
data/bam-0.5.1/src/lua/lstrlib.c:141: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(p, s, l * sizeof(char));  /* last copy (not followed by separator) */
data/bam-0.5.1/src/lua/lstrlib.c:915: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 buff[10];
data/bam-0.5.1/src/lua/lstrlib.c:995: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(form, strfrmt, ((p - strfrmt) + 1) * sizeof(char));
data/bam-0.5.1/src/lua/lstrlib.c:1029: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 form[MAX_FORMAT];  /* to store the format ('%...') */
data/bam-0.5.1/src/lua/lstrlib.c:1144: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 buff[5 * sizeof(lua_Number)];  /* enough for any float type */
data/bam-0.5.1/src/lua/ltablib.c:263: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(buff, &c, sof(c) * sizeof(unsigned int));
data/bam-0.5.1/src/lua/ltablib.c:264: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(buff + sof(c), &t, sof(t) * sizeof(unsigned int));
data/bam-0.5.1/src/lua/ltm.c:29:17:  [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.
LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = {
data/bam-0.5.1/src/lua/ltm.h:55:17:  [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.
LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS];
data/bam-0.5.1/src/lua/lua.h:454: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 short_src[LUA_IDSIZE]; /* (S) */
data/bam-0.5.1/src/lua/lundump.c:95: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 buff[LUAI_MAXSHORTLEN];
data/bam-0.5.1/src/lua/lundump.c:220: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 buff[sizeof(LUA_SIGNATURE) + sizeof(LUAC_DATA)]; /* larger than both */
data/bam-0.5.1/src/lua/lvm.c:464: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(buff + tl, svalue(top - n), l * sizeof(char));
data/bam-0.5.1/src/lua/lvm.c:498: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 buff[LUAI_MAXSHORTLEN];
data/bam-0.5.1/src/lua/lzio.c:60: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(b, z->p, m);
data/bam-0.5.1/src/luafuncs.c:73: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(listitem+1, orgstr, len+1);
data/bam-0.5.1/src/luafuncs.c:324: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(node->job->filter, str, len+1);
data/bam-0.5.1/src/luafuncs.c:564: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 hashstr[64];
data/bam-0.5.1/src/luafuncs.c:759: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 string_buffer[1024*4];
data/bam-0.5.1/src/luafuncs.c:811: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(current, prefix, prefix_len); current += prefix_len;
data/bam-0.5.1/src/luafuncs.c:812: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(current, item, item_len); current += item_len;
data/bam-0.5.1/src/luafuncs.c:813: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(current, postfix, postfix_len); current += postfix_len;
data/bam-0.5.1/src/luafuncs.c:858: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 buffer[1024];
data/bam-0.5.1/src/luafuncs.c:935: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 recursepath[1024];
data/bam-0.5.1/src/luafuncs.c:947: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 dir[1024];
data/bam-0.5.1/src/luafuncs.c:1014: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[1024*2];
data/bam-0.5.1/src/luafuncs.c:1060: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 buffer[2*1024];
data/bam-0.5.1/src/luafuncs.c:1125: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[1024];
data/bam-0.5.1/src/main.c:88:14:  [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 const char *option_targets[128] = {0};
data/bam-0.5.1/src/main.c:91:14:  [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 const char *option_scriptargs[128] = {0};
data/bam-0.5.1/src/main.c:96:8:  [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 depcache_filename[32] = {0};
data/bam-0.5.1/src/main.c:448: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 cwd[MAX_PATH_LENGTH];
data/bam-0.5.1/src/main.c:541: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 cwd[MAX_PATH_LENGTH];
data/bam-0.5.1/src/main.c:542: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 path[MAX_PATH_LENGTH];
data/bam-0.5.1/src/main.c:758: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 hashstr[64];
data/bam-0.5.1/src/main.c:975: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 *ptrs[64];
data/bam-0.5.1/src/main.c:977: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[1024];
data/bam-0.5.1/src/main.c:1069:22:  [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).
		session.eventlog = fopen(option_debug_eventlog, "w");
data/bam-0.5.1/src/main.c:1092:21:  [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).
		session.threads = atoi(option_threads_str);
data/bam-0.5.1/src/node.c:18: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(str, src, len);
data/bam-0.5.1/src/path.c:57: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 *dirs[128];
data/bam-0.5.1/src/path.c:236: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(output, extend, extend_len+1);
data/bam-0.5.1/src/path.c:254: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(output, extend, extend_len+1);
data/bam-0.5.1/src/path.c:260: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(output, base, base_len);
data/bam-0.5.1/src/support.c:34: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 buffer[1024*2];
data/bam-0.5.1/src/support.c:40:4:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
			strcat(buffer, "/*");
data/bam-0.5.1/src/support.c:117: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 buffer[512] = {0};
data/bam-0.5.1/src/support.c:160: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).
			observe_pid = atoi(buffer);
data/bam-0.5.1/src/support.c:175:5:  [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(buffer, "%d", GetCurrentProcessId());
data/bam-0.5.1/src/support.c:310: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 buffer[1024];
data/bam-0.5.1/src/support.c:537: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 buffer[1024*4];
data/bam-0.5.1/src/support.c:571: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[32*1024];
data/bam-0.5.1/src/support.c:577: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+1, cmd, len);
data/bam-0.5.1/src/support.c:590: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 buffer[1024];
data/bam-0.5.1/src/support.c:673: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[MAX_PATH_LENGTH];
data/bam-0.5.1/src/support.c:729:23:  [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 const unsigned char tolower_table[256] = {
data/bam-0.5.1/src/support.c:771: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(output, "%08x%08x", (unsigned)(value>>32), (unsigned)(value&0xffffffff));
data/bam-0.5.1/src/tools/txt2c.c:23:11:  [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).
		input = fopen(argv[f], "r");
data/bam-0.5.1/src/cache.c:70:33:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	#define io_read(f, data, size) read(f, data, size)
data/bam-0.5.1/src/dep_cpp.c:270: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 flen = strlen(node->filename)-1;
data/bam-0.5.1/src/dep_cpp.c:302: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 flen = strlen(filename);
data/bam-0.5.1/src/lua/lauxlib.c:402:21:  [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 = (def ? strlen(def) : 0);
data/bam-0.5.1/src/lua/lauxlib.c:539: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).
  luaL_addlstring(B, s, strlen(s));
data/bam-0.5.1/src/lua/lauxlib.c:675:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getc(lf->f);
data/bam-0.5.1/src/lua/lauxlib.c:680:10:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return getc(lf->f);  /* return next character */
data/bam-0.5.1/src/lua/lauxlib.c:695:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(lf->f);
data/bam-0.5.1/src/lua/lauxlib.c:697:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    *cp = getc(lf->f);  /* skip end-of-line, if present */
data/bam-0.5.1/src/lua/lauxlib.c:766: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).
  return luaL_loadbuffer(L, s, strlen(s), s);
data/bam-0.5.1/src/lua/lauxlib.c:853: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).
    if (e == NULL) e = fname + strlen(fname);
data/bam-0.5.1/src/lua/lauxlib.c:986: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).
  size_t l = strlen(p);
data/bam-0.5.1/src/lua/ldblib.c:409:36:  [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 (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") ||
data/bam-0.5.1/src/lua/liolib.c:43:30:  [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).
	(strspn(mode, L_MODEEXT) == strlen(mode)))
data/bam-0.5.1/src/lua/liolib.c:89:20:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define l_getc(f)		getc(f)
data/bam-0.5.1/src/lua/liolib.c:469:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int c = getc(f);
data/bam-0.5.1/src/lua/loadlib.c:390: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).
  if (l == NULL) l = path + strlen(path);
data/bam-0.5.1/src/lua/lobject.c:284: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).
    if (strlen(s) > L_MAXLENNUM || pdot == NULL)
data/bam-0.5.1/src/lua/lobject.c:410:23:  [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).
        pushstr(L, s, strlen(s));
data/bam-0.5.1/src/lua/lobject.c:461: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).
  pushstr(L, fmt, strlen(fmt));
data/bam-0.5.1/src/lua/lobject.c:487: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).
  size_t l = strlen(source);
data/bam-0.5.1/src/lua/lstring.c:231:31:  [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).
  p[0] = luaS_newlstr(L, str, strlen(str));
data/bam-0.5.1/src/lua/lstrlib.c:585:13:  [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).
    upto += strlen(p + upto) + 1;  /* may have more after \0 */
data/bam-0.5.1/src/lua/lstrlib.c:1006: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).
  size_t l = strlen(form);
data/bam-0.5.1/src/lua/lstrlib.c:1007: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 lm = strlen(lenmod);
data/bam-0.5.1/src/lua/lstrlib.c:1068:35:  [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).
            luaL_argcheck(L, l == strlen(s), arg, "string contains zeros");
data/bam-0.5.1/src/lua/lstrlib.c:1398: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).
        luaL_argcheck(L, strlen(s) == len, arg, "string contains zeros");
data/bam-0.5.1/src/lua/lstrlib.c:1522: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).
        size_t len = (int)strlen(data + pos);
data/bam-0.5.1/src/lua/lundump.c:221: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).
  size_t len = strlen(s);
data/bam-0.5.1/src/lua/lvm.c:258:20:  [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(l);  /* index of first '\0' in both strings */
data/bam-0.5.1/src/luafuncs.c:854:5:  [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(lua_tostring(L, 1)) < 1)
data/bam-0.5.1/src/luafuncs.c:895:22:  [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 no_pathed_len = strlen(no_pathed);
data/bam-0.5.1/src/luafuncs.c:938:3:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
		strcat(recursepath, "/");
data/bam-0.5.1/src/luafuncs.c:952: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).
	dirlen = strlen(dir);
data/bam-0.5.1/src/luafuncs.c:972: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).
	info->end_len = strlen(info->end_str);
data/bam-0.5.1/src/luafuncs.c:1140:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buffer, path, sizeof(buffer));
data/bam-0.5.1/src/main.c:313:10:  [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 = strlen(*p);
data/bam-0.5.1/src/main.c:947: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 len = strlen(params[i]);
data/bam-0.5.1/src/node.c:116:46:  [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).
	job->label = duplicate_string(graph, label, strlen(label));
data/bam-0.5.1/src/node.c:117:50:  [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).
	job->cmdline = duplicate_string(graph, cmdline, strlen(cmdline));
data/bam-0.5.1/src/node.c:165: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).
		node->filename_len = strlen(filename)+1;
data/bam-0.5.1/src/node.c:351:54:  [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).
	link->str = duplicate_string(node->graph, filename, strlen(filename));
data/bam-0.5.1/src/path.c:36:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			for(; read != cur; read++, dest++)
data/bam-0.5.1/src/path.c:43:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				*dest = *read;
data/bam-0.5.1/src/path.c:154:5:  [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) > 2 && isalpha(path[0]) && path[1] == ':' && path_is_separator(path[2]))
data/bam-0.5.1/src/path.c:225: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).
		extend_len = strlen(extend);
data/bam-0.5.1/src/path.c:242: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).
		base_len = strlen(base);
data/bam-0.5.1/src/support.c:41: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).
			startpoint = buffer + strlen(path)+1;
data/bam-0.5.1/src/support.c:45:4:  [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(buffer, "*");
data/bam-0.5.1/src/support.c:324: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).
			startpoint = buffer + strlen(buffer);
data/bam-0.5.1/src/support.c:398:3:  [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/bam-0.5.1/src/support.c:573: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(cmd);
data/bam-0.5.1/src/support.c:597: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).
		matchlen = strlen(filter);
data/bam-0.5.1/src/support.c:619:15:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					char t = fgetc(fp);
data/bam-0.5.1/src/support.c:623:11:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
						t = fgetc(fp);
data/bam-0.5.1/src/tools/txt2c.c:27:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c = fgetc(input);

ANALYSIS SUMMARY:

Hits = 216
Lines analyzed = 30551 in approximately 0.84 seconds (36391 lines/second)
Physical Source Lines of Code (SLOC) = 21315
Hits@level = [0] 165 [1]  56 [2] 124 [3]  13 [4]  23 [5]   0
Hits@level+ = [0+] 381 [1+] 216 [2+] 160 [3+]  36 [4+]  23 [5+]   0
Hits/KSLOC@level+ = [0+] 17.8747 [1+] 10.1337 [2+] 7.50645 [3+] 1.68895 [4+] 1.07905 [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.