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/lua5.1-5.1.5/etc/all.c
Examining data/lua5.1-5.1.5/etc/min.c
Examining data/lua5.1-5.1.5/etc/lua.hpp
Examining data/lua5.1-5.1.5/etc/noparser.c
Examining data/lua5.1-5.1.5/src/loadlib.c
Examining data/lua5.1-5.1.5/src/ltable.c
Examining data/lua5.1-5.1.5/src/linit.c
Examining data/lua5.1-5.1.5/src/lobject.h
Examining data/lua5.1-5.1.5/src/ltable.h
Examining data/lua5.1-5.1.5/src/lzio.c
Examining data/lua5.1-5.1.5/src/lfunc.h
Examining data/lua5.1-5.1.5/src/lfunc.c
Examining data/lua5.1-5.1.5/src/lopcodes.h
Examining data/lua5.1-5.1.5/src/loslib.c
Examining data/lua5.1-5.1.5/src/lundump.c
Examining data/lua5.1-5.1.5/src/lvm.h
Examining data/lua5.1-5.1.5/src/lundump.h
Examining data/lua5.1-5.1.5/src/lstate.h
Examining data/lua5.1-5.1.5/src/ltm.c
Examining data/lua5.1-5.1.5/src/lbaselib.c
Examining data/lua5.1-5.1.5/src/lapi.h
Examining data/lua5.1-5.1.5/src/ldump.c
Examining data/lua5.1-5.1.5/src/lauxlib.c
Examining data/lua5.1-5.1.5/src/lcode.h
Examining data/lua5.1-5.1.5/src/lparser.h
Examining data/lua5.1-5.1.5/src/ldebug.c
Examining data/lua5.1-5.1.5/src/ldblib.c
Examining data/lua5.1-5.1.5/src/lua.c
Examining data/lua5.1-5.1.5/src/lgc.h
Examining data/lua5.1-5.1.5/src/lapi.c
Examining data/lua5.1-5.1.5/src/liolib.c
Examining data/lua5.1-5.1.5/src/lua.h
Examining data/lua5.1-5.1.5/src/ldebug.h
Examining data/lua5.1-5.1.5/src/lmem.c
Examining data/lua5.1-5.1.5/src/lstate.c
Examining data/lua5.1-5.1.5/src/lobject.c
Examining data/lua5.1-5.1.5/src/lparser.c
Examining data/lua5.1-5.1.5/src/llimits.h
Examining data/lua5.1-5.1.5/src/lzio.h
Examining data/lua5.1-5.1.5/src/ldo.h
Examining data/lua5.1-5.1.5/src/lmathlib.c
Examining data/lua5.1-5.1.5/src/lauxlib.h
Examining data/lua5.1-5.1.5/src/ltm.h
Examining data/lua5.1-5.1.5/src/print.c
Examining data/lua5.1-5.1.5/src/llex.h
Examining data/lua5.1-5.1.5/src/ltablib.c
Examining data/lua5.1-5.1.5/src/lmem.h
Examining data/lua5.1-5.1.5/src/lvm.c
Examining data/lua5.1-5.1.5/src/llex.c
Examining data/lua5.1-5.1.5/src/lstring.h
Examining data/lua5.1-5.1.5/src/lgc.c
Examining data/lua5.1-5.1.5/src/lstrlib.c
Examining data/lua5.1-5.1.5/src/lcode.c
Examining data/lua5.1-5.1.5/src/luac.c
Examining data/lua5.1-5.1.5/src/lstring.c
Examining data/lua5.1-5.1.5/src/lualib.h
Examining data/lua5.1-5.1.5/src/lopcodes.c
Examining data/lua5.1-5.1.5/src/luaconf.h
Examining data/lua5.1-5.1.5/src/ldo.c
Examining data/lua5.1-5.1.5/debian/examples/debian/binary_module/lua-foo.c
Examining data/lua5.1-5.1.5/debian/examples/debian/binary_module/app.c
Examining data/lua5.1-5.1.5/debian/examples/debian/static_app/app.c

FINAL RESULTS:

data/lua5.1-5.1.5/src/liolib.c:275:7:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
  if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {
data/lua5.1-5.1.5/src/liolib.c:420:11:  [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)) > 0;
data/lua5.1-5.1.5/src/lobject.c:198:7:  [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(out, source);
data/lua5.1-5.1.5/src/lobject.c:210:9:  [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(out, source);
data/lua5.1-5.1.5/src/loslib.c:39:22:  [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.
  lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
data/lua5.1-5.1.5/src/lstrlib.c:750: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, LUA_INTFRMLEN);
data/lua5.1-5.1.5/src/lstrlib.c:777:11:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
          sprintf(buff, form, (int)luaL_checknumber(L, arg));
data/lua5.1-5.1.5/src/lstrlib.c:782:11:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
          sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg));
data/lua5.1-5.1.5/src/lstrlib.c:787:11:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
          sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));
data/lua5.1-5.1.5/src/lstrlib.c:792:11:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
          sprintf(buff, form, (double)luaL_checknumber(L, arg));
data/lua5.1-5.1.5/src/lstrlib.c:810:13:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
            sprintf(buff, form, s);
data/lua5.1-5.1.5/src/luaconf.h:534:29:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
#define lua_number2str(s,n)	sprintf((s), LUA_NUMBER_FMT, (n))
data/lua5.1-5.1.5/src/luaconf.h:681:50:  [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 lua_popen(L,c,m)	((void)L, fflush(NULL), popen(c,m))
data/lua5.1-5.1.5/src/print.c:60:2:  [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(bvalue(o) ? "true" : "false");
data/lua5.1-5.1.5/src/print.c:63:2:  [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(LUA_NUMBER_FMT,nvalue(o));
data/lua5.1-5.1.5/src/lmathlib.c:210:3:  [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.
  srand(luaL_checkint(L, 1));
data/lua5.1-5.1.5/src/loadlib.c:594: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(envname);
data/lua5.1-5.1.5/src/loslib.c:69: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/lua5.1-5.1.5/src/lua.c:324: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 *init = getenv(LUA_INIT);
data/lua5.1-5.1.5/src/luaconf.h:668:33:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
#define lua_tmpnam(b,e)		{ e = (tmpnam(b) == NULL); }
data/lua5.1-5.1.5/src/lauxlib.c:459: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, s, vl);  /* put it there */
data/lua5.1-5.1.5/src/lauxlib.c:525: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[LUAL_BUFFERSIZE];
data/lua5.1-5.1.5/src/lauxlib.c:564: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/lua5.1-5.1.5/src/lauxlib.h:133: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[LUAL_BUFFERSIZE];
data/lua5.1-5.1.5/src/ldblib.c:285: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/lua5.1-5.1.5/src/ldblib.c:304: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/lua5.1-5.1.5/src/ldebug.c:610: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[LUA_IDSIZE];  /* add file:line information */
data/lua5.1-5.1.5/src/ldump.c:145: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 h[LUAC_HEADERSIZE];
data/lua5.1-5.1.5/src/liolib.c:165: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).
  *pf = fopen(filename, mode);
data/lua5.1-5.1.5/src/liolib.c:185:9:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  *pf = tmpfile();
data/lua5.1-5.1.5/src/liolib.c:205: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).
      *pf = fopen(filename, mode);
data/lua5.1-5.1.5/src/liolib.c:257: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).
    *pf = fopen(filename, "r");
data/lua5.1-5.1.5/src/llex.c:103: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[MAXSRC];
data/lua5.1-5.1.5/src/loadlib.c:98: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/lua5.1-5.1.5/src/loadlib.c:114: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/lua5.1-5.1.5/src/loadlib.c:333: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/lua5.1-5.1.5/src/lobject.c:127: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[2];
data/lua5.1-5.1.5/src/lobject.c:144: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/lua5.1-5.1.5/src/lobject.c:145: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(buff, "%p", va_arg(argp, void *));
data/lua5.1-5.1.5/src/lobject.c:154: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[3];
data/lua5.1-5.1.5/src/lobject.c:196:9:  [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(out, "...");
data/lua5.1-5.1.5/src/lobject.c:204:7:  [2] (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 string.
      strcpy(out, "[string \"");
data/lua5.1-5.1.5/src/lobject.c:207:9:  [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(out, "...");
data/lua5.1-5.1.5/src/lobject.c:211:7:  [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(out, "\"]");
data/lua5.1-5.1.5/src/lopcodes.c:16:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
const char *const luaP_opnames[NUM_OPCODES+1] = {
data/lua5.1-5.1.5/src/lopcodes.h:261: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_DATA const char *const luaP_opnames[NUM_OPCODES+1];  /* opcode names */
data/lua5.1-5.1.5/src/loslib.c:58: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/lua5.1-5.1.5/src/loslib.c:149: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[3];
data/lua5.1-5.1.5/src/loslib.c:158: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[200];  /* should be big enough for any conversion result */
data/lua5.1-5.1.5/src/lstring.c:62: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(ts+1, str, l*sizeof(char));
data/lua5.1-5.1.5/src/lstrlib.c:770: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/lua5.1-5.1.5/src/lstrlib.c:771: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[MAX_ITEM];  /* to store the formatted item */
data/lua5.1-5.1.5/src/lua.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 buffer[LUA_MAXINPUT];
data/lua5.1-5.1.5/src/lua.h:356: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/lua5.1-5.1.5/src/luac.c:175:38:  [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* D= (output==NULL) ? stdout : fopen(output,"wb");
data/lua5.1-5.1.5/src/luaconf.h:661:2:  [2] (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 string.
	strcpy(b, "/tmp/lua_XXXXXX"); \
data/lua5.1-5.1.5/src/luaconf.h:662:6:  [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/lua5.1-5.1.5/src/lundump.c:185: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 h[LUAC_HEADERSIZE];
data/lua5.1-5.1.5/src/lundump.c:186: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 s[LUAC_HEADERSIZE];
data/lua5.1-5.1.5/src/lundump.c:217: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(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1);
data/lua5.1-5.1.5/src/lvm.c:51: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 s[LUAI_MAXNUMBER2STR];
data/lua5.1-5.1.5/src/lvm.c:306: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(buffer+tl, svalue(top-i), l);
data/lua5.1-5.1.5/src/lzio.c:64: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/lua5.1-5.1.5/src/lapi.c:458: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).
    lua_pushlstring(L, s, strlen(s));
data/lua5.1-5.1.5/src/lauxlib.c:169: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/lua5.1-5.1.5/src/lauxlib.c:343: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/lua5.1-5.1.5/src/lauxlib.c:363: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/lua5.1-5.1.5/src/lauxlib.c:443: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/lua5.1-5.1.5/src/lauxlib.c:567:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  c = getc(lf.f);
data/lua5.1-5.1.5/src/lauxlib.c:570:17:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((c = getc(lf.f)) != EOF && c != '\n') ;  /* skip first line */
data/lua5.1-5.1.5/src/lauxlib.c:571:24:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (c == '\n') c = getc(lf.f);
data/lua5.1-5.1.5/src/lauxlib.c:577:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
data/lua5.1-5.1.5/src/lauxlib.c:619: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/lua5.1-5.1.5/src/ldblib.c:309: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/lua5.1-5.1.5/src/liolib.c:287:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int c = getc(f);
data/lua5.1-5.1.5/src/liolib.c:304: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).
    l = strlen(p);
data/lua5.1-5.1.5/src/llex.c:69: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).
    lua_assert(strlen(luaX_tokens[i])+1 <= TOKEN_LEN);
data/lua5.1-5.1.5/src/loadlib.c:345: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/lua5.1-5.1.5/src/lobject.c:184:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(out, source+1, bufflen);  /* remove first char */
data/lua5.1-5.1.5/src/lobject.c:192: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).
      l = strlen(source);
data/lua5.1-5.1.5/src/lobject.c:193:7:  [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(out, "");
data/lua5.1-5.1.5/src/lobject.c:206:9:  [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.
        strncat(out, source, len);
data/lua5.1-5.1.5/src/lstring.h:20:44:  [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).
#define luaS_new(L, s)	(luaS_newlstr(L, s, strlen(s)))
data/lua5.1-5.1.5/src/lstrlib.c:740:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(form, strfrmt, p - strfrmt + 1);
data/lua5.1-5.1.5/src/lstrlib.c:748: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/lua5.1-5.1.5/src/lstrlib.c:819:33:  [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, buff, strlen(buff));
data/lua5.1-5.1.5/src/lua.c:141:38:  [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 status = luaL_loadbuffer(L, s, strlen(s), name) || docall(L, 0, 1);
data/lua5.1-5.1.5/src/lua.c:184:7:  [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).
  l = strlen(b);
data/lua5.1-5.1.5/src/lvm.c:212: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 */

ANALYSIS SUMMARY:

Hits = 89
Lines analyzed = 17160 in approximately 0.50 seconds (34080 lines/second)
Physical Source Lines of Code (SLOC) = 12738
Hits@level = [0]  65 [1]  26 [2]  43 [3]   5 [4]  15 [5]   0
Hits@level+ = [0+] 154 [1+]  89 [2+]  63 [3+]  20 [4+]  15 [5+]   0
Hits/KSLOC@level+ = [0+] 12.0898 [1+] 6.98697 [2+] 4.94583 [3+] 1.57011 [4+] 1.17758 [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.