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/eja-9.5.20/eja.c Examining data/eja-9.5.20/lua/src/loslib.c Examining data/eja-9.5.20/lua/src/lzio.h Examining data/eja-9.5.20/lua/src/lua.h Examining data/eja-9.5.20/lua/src/loadlib.c Examining data/eja-9.5.20/lua/src/lauxlib.c Examining data/eja-9.5.20/lua/src/lparser.c Examining data/eja-9.5.20/lua/src/ldblib.c Examining data/eja-9.5.20/lua/src/lmathlib.c Examining data/eja-9.5.20/lua/src/lgc.h Examining data/eja-9.5.20/lua/src/lapi.c Examining data/eja-9.5.20/lua/src/lundump.c Examining data/eja-9.5.20/lua/src/lstate.h Examining data/eja-9.5.20/lua/src/lbaselib.c Examining data/eja-9.5.20/lua/src/llex.h Examining data/eja-9.5.20/lua/src/lualib.h Examining data/eja-9.5.20/lua/src/lcode.h Examining data/eja-9.5.20/lua/src/lctype.h Examining data/eja-9.5.20/lua/src/llimits.h Examining data/eja-9.5.20/lua/src/llex.c Examining data/eja-9.5.20/lua/src/lgc.c Examining data/eja-9.5.20/lua/src/ldump.c Examining data/eja-9.5.20/lua/src/lobject.c Examining data/eja-9.5.20/lua/src/lcorolib.c Examining data/eja-9.5.20/lua/src/ldo.c Examining data/eja-9.5.20/lua/src/lstate.c Examining data/eja-9.5.20/lua/src/lfunc.c Examining data/eja-9.5.20/lua/src/lobject.h Examining data/eja-9.5.20/lua/src/lcode.c Examining data/eja-9.5.20/lua/src/lvm.c Examining data/eja-9.5.20/lua/src/lopcodes.c Examining data/eja-9.5.20/lua/src/ltable.h Examining data/eja-9.5.20/lua/src/lstring.c Examining data/eja-9.5.20/lua/src/ldebug.h Examining data/eja-9.5.20/lua/src/ldebug.c Examining data/eja-9.5.20/lua/src/lstring.h Examining data/eja-9.5.20/lua/src/ltm.h Examining data/eja-9.5.20/lua/src/lua.hpp Examining data/eja-9.5.20/lua/src/lvm.h Examining data/eja-9.5.20/lua/src/lmem.h Examining data/eja-9.5.20/lua/src/lauxlib.h Examining data/eja-9.5.20/lua/src/ltablib.c Examining data/eja-9.5.20/lua/src/lctype.c Examining data/eja-9.5.20/lua/src/lzio.c Examining data/eja-9.5.20/lua/src/lfunc.h Examining data/eja-9.5.20/lua/src/ltm.c Examining data/eja-9.5.20/lua/src/lmem.c Examining data/eja-9.5.20/lua/src/ltable.c Examining data/eja-9.5.20/lua/src/lopcodes.h Examining data/eja-9.5.20/lua/src/ldo.h Examining data/eja-9.5.20/lua/src/lua.c Examining data/eja-9.5.20/lua/src/luaconf.h Examining data/eja-9.5.20/lua/src/lparser.h Examining data/eja-9.5.20/lua/src/lapi.h Examining data/eja-9.5.20/lua/src/liolib.c Examining data/eja-9.5.20/lua/src/lbitlib.c Examining data/eja-9.5.20/lua/src/luac.c Examining data/eja-9.5.20/lua/src/lstrlib.c Examining data/eja-9.5.20/lua/src/linit.c Examining data/eja-9.5.20/lua/src/lundump.h FINAL RESULTS: data/eja-9.5.20/lua/src/liolib.c:58: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/eja-9.5.20/lua/src/liolib.c:352: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/eja-9.5.20/lua/src/liolib.c:521: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/eja-9.5.20/lua/src/loslib.c:82: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/eja-9.5.20/lua/src/lstrlib.c:886: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/eja-9.5.20/lua/src/lstrlib.c:914:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, luaL_checkint(L, arg)); data/eja-9.5.20/lua/src/lstrlib.c:924:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, ni); data/eja-9.5.20/lua/src/lstrlib.c:934:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, ni); data/eja-9.5.20/lua/src/lstrlib.c:943:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, (LUA_FLTFRM_T)luaL_checknumber(L, arg)); data/eja-9.5.20/lua/src/lstrlib.c:960:18: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, s); data/eja-9.5.20/lua/src/luac.c:260: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/eja-9.5.20/lua/src/luac.c:263: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/eja-9.5.20/lua/src/luaconf.h:223:3: [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/eja-9.5.20/lua/src/luaconf.h:404: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/eja-9.5.20/lua/src/lmathlib.c:227: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_checkunsigned(L, 1)); data/eja-9.5.20/lua/src/loadlib.c:639: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/eja-9.5.20/lua/src/loadlib.c:641: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/eja-9.5.20/lua/src/loslib.c:57:33: [3] (tmpfile) tmpnam: Temporary file race condition (CWE-377). #define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } data/eja-9.5.20/lua/src/loslib.c:117: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/eja-9.5.20/lua/src/lua.c:425: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(name + 1); data/eja-9.5.20/lua/src/lua.c:428: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. init = getenv(name + 1); /* try alternative name */ data/eja-9.5.20/eja.c:116: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 addr[INET6_ADDRSTRLEN]; data/eja-9.5.20/lua/src/lauxlib.c:449: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(newbuff, B->b, B->n * sizeof(char)); data/eja-9.5.20/lua/src/lauxlib.c:461: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(b, s, l * sizeof(char)); data/eja-9.5.20/lua/src/lauxlib.c:565: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]; /* area for reading file */ data/eja-9.5.20/lua/src/lauxlib.c:642: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/eja-9.5.20/lua/src/lauxlib.h:148: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/eja-9.5.20/lua/src/ldblib.c:336: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/eja-9.5.20/lua/src/ldblib.c:356: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/eja-9.5.20/lua/src/ldebug.c:577: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/eja-9.5.20/lua/src/liolib.c:220: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/eja-9.5.20/lua/src/liolib.c:232: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/eja-9.5.20/lua/src/liolib.c:258: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/eja-9.5.20/lua/src/llex.c:105: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/eja-9.5.20/lua/src/loadlib.c:169: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/eja-9.5.20/lua/src/loadlib.c:185: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/eja-9.5.20/lua/src/loadlib.c:331: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/eja-9.5.20/lua/src/lobject.c:208: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/eja-9.5.20/lua/src/lobject.c:209:17: [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. int l = sprintf(buff, "%p", va_arg(argp, void *)); data/eja-9.5.20/lua/src/lobject.c:250: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/eja-9.5.20/lua/src/lobject.c:256: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/eja-9.5.20/lua/src/lobject.c:264: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/eja-9.5.20/lua/src/lobject.c:268: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/eja-9.5.20/lua/src/lobject.c:284: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/eja-9.5.20/lua/src/lopcodes.c:17: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/eja-9.5.20/lua/src/lopcodes.h:281: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/eja-9.5.20/lua/src/loslib.c:49:9: [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/eja-9.5.20/lua/src/loslib.c:50: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/eja-9.5.20/lua/src/loslib.c:106: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/eja-9.5.20/lua/src/loslib.c:220: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]; data/eja-9.5.20/lua/src/loslib.c:229: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/eja-9.5.20/lua/src/lstate.c:61: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[LUAI_EXTRASPACE]; data/eja-9.5.20/lua/src/lstate.c:87: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 + p, &t, sizeof(t)); p += sizeof(t); } data/eja-9.5.20/lua/src/lstate.c:90: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/eja-9.5.20/lua/src/lstring.c:107: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/eja-9.5.20/lua/src/lstrlib.c:121: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/eja-9.5.20/lua/src/lstrlib.c:123: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)); p += lsep; data/eja-9.5.20/lua/src/lstrlib.c:126: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/eja-9.5.20/lua/src/lstrlib.c:843: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/eja-9.5.20/lua/src/lstrlib.c:845: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, "\\%d", (int)uchar(*s)); data/eja-9.5.20/lua/src/lstrlib.c:847: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, "\\%03d", (int)uchar(*s)); data/eja-9.5.20/lua/src/lstrlib.c:872: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/eja-9.5.20/lua/src/lstrlib.c:906: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/eja-9.5.20/lua/src/ltm.c:24: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/eja-9.5.20/lua/src/ltm.h:49: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/eja-9.5.20/lua/src/lua.c:261: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/eja-9.5.20/lua/src/lua.h:412: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/eja-9.5.20/lua/src/luac.c:178: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/eja-9.5.20/lua/src/lundump.c:195:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s,h,sizeof(char)); /* first char already read */ data/eja-9.5.20/lua/src/lundump.c:247: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)-sizeof(char)); data/eja-9.5.20/lua/src/lundump.c:257: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,LUAC_TAIL,sizeof(LUAC_TAIL)-sizeof(char)); data/eja-9.5.20/lua/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/eja-9.5.20/lua/src/lvm.c:324: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 * sizeof(char)); data/eja-9.5.20/lua/src/lzio.c:58: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/eja-9.5.20/eja.c:392:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, luaL_checkstring(L, 4), IFNAMSIZ); data/eja-9.5.20/lua/src/lauxlib.c:368: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/eja-9.5.20/lua/src/lauxlib.c:467: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/eja-9.5.20/lua/src/lauxlib.c:601:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(lf->f); data/eja-9.5.20/lua/src/lauxlib.c:606: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/eja-9.5.20/lua/src/lauxlib.c:621:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(lf->f); data/eja-9.5.20/lua/src/lauxlib.c:623: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/eja-9.5.20/lua/src/lauxlib.c:692: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/eja-9.5.20/lua/src/lauxlib.c:773: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/eja-9.5.20/lua/src/lauxlib.c:905: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/eja-9.5.20/lua/src/ldblib.c:361: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/eja-9.5.20/lua/src/liolib.c:268:58: [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_error(L, "standard %s file is closed", findex + strlen(IO_PREFIX)); data/eja-9.5.20/lua/src/liolib.c:364:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(f); data/eja-9.5.20/lua/src/liolib.c:381: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/eja-9.5.20/lua/src/loadlib.c:343: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/eja-9.5.20/lua/src/lobject.c:190: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/eja-9.5.20/lua/src/lobject.c:227: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/eja-9.5.20/lua/src/lobject.c:253: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/eja-9.5.20/lua/src/lstring.c:171: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). return luaS_newlstr(L, str, strlen(str)); data/eja-9.5.20/lua/src/lstrlib.c:571: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/eja-9.5.20/lua/src/lstrlib.c:883: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/eja-9.5.20/lua/src/lstrlib.c:884: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/eja-9.5.20/lua/src/lua.c:187: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). luai_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); data/eja-9.5.20/lua/src/lua.c:218: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); data/eja-9.5.20/lua/src/lua.c:269: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/eja-9.5.20/lua/src/lvm.c:218: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 = 100 Lines analyzed = 20774 in approximately 0.61 seconds (33826 lines/second) Physical Source Lines of Code (SLOC) = 15010 Hits@level = [0] 66 [1] 26 [2] 53 [3] 7 [4] 14 [5] 0 Hits@level+ = [0+] 166 [1+] 100 [2+] 74 [3+] 21 [4+] 14 [5+] 0 Hits/KSLOC@level+ = [0+] 11.0593 [1+] 6.66223 [2+] 4.93005 [3+] 1.39907 [4+] 0.932712 [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.