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/luajit-2.1.0~beta3+dfsg/dynasm/dasm_mips.h
Examining data/luajit-2.1.0~beta3+dfsg/dynasm/dasm_x86.h
Examining data/luajit-2.1.0~beta3+dfsg/dynasm/dasm_proto.h
Examining data/luajit-2.1.0~beta3+dfsg/dynasm/dasm_arm.h
Examining data/luajit-2.1.0~beta3+dfsg/dynasm/dasm_arm64.h
Examining data/luajit-2.1.0~beta3+dfsg/dynasm/dasm_ppc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_err.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_lex.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_emit_arm64.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_package.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt_num.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_cparse.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ff.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_str.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_libdef.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_bc.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lualib.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_debug.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_state.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_carith.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_emit_arm.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ffdef.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_obj.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_base.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_vmevent.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_cdata.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_api.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_char.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ir.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_aux.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_profile.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_trace.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_opt_sink.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_recdef.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_strscan.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_emit_ppc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/ljamalg.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_meta.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_clib.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_opt_loop.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_emit_x86.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_parse.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_asm.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_func.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_tab.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_errmsg.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_record.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lua.hpp
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_alloc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_lib.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_table.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_dispatch.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_mcode.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_gc.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_vm.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_target_mips.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_udata.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_math.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_gdbjit.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_buf.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_trace.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_strscan.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_bit.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_meta.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_opt_dce.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_bcread.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_vmevent.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_cdata.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_target_x86.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_opt_narrow.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_asm_ppc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_char.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_target_arm64.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lauxlib.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ir.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_profile.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ffrecord.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_state.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_opt_mem.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_carith.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_opt_fold.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_target.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_bcdump.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_traceerr.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_ffi.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_folddef.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_os.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_err.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lua.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_lex.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_crecord.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_init.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_asm_arm.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_cparse.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_str.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_vmmath.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_io.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_bc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_string.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_udata.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_target_arm.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_gdbjit.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_buf.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_debug.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_bcwrite.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_mcode.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_gc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_libbc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.h
Examining data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c
Examining data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c
Examining data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_fold.c
Examining data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c
Examining data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c
Examining data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_asm.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lib_jit.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_bcdef.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_load.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_record.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_asm_x86.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_alloc.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_lib.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_snap.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_clib.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ccallback.h
Examining data/luajit-2.1.0~beta3+dfsg/src/luaconf.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_parse.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_func.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_tab.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_dispatch.c
Examining data/luajit-2.1.0~beta3+dfsg/src/luajit.c
Examining data/luajit-2.1.0~beta3+dfsg/src/luajit.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ccallback.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_def.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_frame.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_target_ppc.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_asm_arm64.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_arch.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_crecord.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_emit_mips.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ffrecord.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_ircall.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_iropt.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_jit.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_obj.h
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_opt_split.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_snap.c
Examining data/luajit-2.1.0~beta3+dfsg/src/lj_asm_mips.h

FINAL RESULTS:

data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:108:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(name, "%s%s%s", symprefix, prefix, suffix);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:123: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(p, name);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:374: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, LUAJIT_VERSION " VM builder.\n");
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:375: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, LUAJIT_COPYRIGHT ", " LUAJIT_URL "\n");
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_asm.c:323: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(ctx->fp,
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:94: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(modname, p);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:142: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(funcname, p);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:225: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(p, name);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:747:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:759:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7601:1:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
sprintf(buff,form,(int)luaL_checknumber(L,arg));
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7606:1:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
sprintf(buff,form,(long)luaL_checknumber(L,arg));
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7611:1:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
sprintf(buff,form,(unsigned long)luaL_checknumber(L,arg));
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7616:1:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
sprintf(buff,form,(double)luaL_checknumber(L,arg));
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7632:1:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
sprintf(buff,form,s);
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:129: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(fp, LUA_NUMBER_SCAN, &d) == 1) {
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:417:13:  [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.
  iof->fp = popen(fname, mode);
data/luajit-2.1.0~beta3+dfsg/src/lib_os.c:52: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/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:332: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(out, src);
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:337: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(out, line == ~(BCLine)0 ? "[builtin:" : "[string \""); out += 9;
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:343:7:  [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(out, src); out += len;
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:345: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(out, line == ~(BCLine)0 ? "]" : "\"]");
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.h:121:27:  [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.
  __attribute__ ((format (printf, 2, 3)))
data/luajit-2.1.0~beta3+dfsg/src/luaconf.h:121:30:  [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/luajit-2.1.0~beta3+dfsg/src/lib_os.c:94:7:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
  if (tmpnam(buf) == NULL)
data/luajit-2.1.0~beta3+dfsg/src/lib_os.c:107: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/luajit-2.1.0~beta3+dfsg/src/lib_package.c:530: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/luajit-2.1.0~beta3+dfsg/src/lj_profile.c:52:26:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
#define profile_lock(ps)	EnterCriticalSection(&ps->lock)
data/luajit-2.1.0~beta3+dfsg/src/lj_profile.c:280:3:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
  InitializeCriticalSection(&ps->lock);
data/luajit-2.1.0~beta3+dfsg/src/luajit.c:494: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/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:99: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 name[256];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:321: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 buf[80];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:468:26:  [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).
  } else if (!(ctx->fp = fopen(ctx->outname, binmode ? "wb" : "w"))) {
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_fold.c:170: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 buf[256];  /* We don't care about analyzing lines longer than that. */
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_fold.c:182: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).
    fp = fopen(fname, "r");
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:15: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 modname[80];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:17: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 funcname[80];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:46: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(optr, p, n);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:53: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 line[80];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:63:12:  [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.
      n += sprintf(line+n, "%d,", *p);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:201: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(optr, libbc_code + ofs, len);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:254: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(dst, src, n);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:299:26:  [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).
      *optr++ = (uint8_t)atoi(p+4);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:363: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 buf[256];  /* We don't care about analyzing lines longer than that. */
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:368: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).
      fp = fopen(fname, "r");
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:33: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 name[8];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:58: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 name[8];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:140: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(sym.n.name, name, len);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:145: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(strtab + strtabofs, name, len);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:163: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(sym.n.name, pesect[sect].name, 8);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:189: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(pesect[PEOBJ_SECT_TEXT].name, ".text", sizeof(".text")-1);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:198: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(pesect[PEOBJ_SECT_PDATA].name, ".pdata", sizeof(".pdata")-1);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:206: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(pesect[PEOBJ_SECT_XDATA].name, ".xdata", sizeof(".xdata")-1);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:214: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(pesect[PEOBJ_SECT_SXDATA].name, ".sxdata", sizeof(".sxdata")-1);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:222: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(pesect[PEOBJ_SECT_RDATA_Z].name, ".rdata$Z", sizeof(".rdata$Z")-1);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:145:28:  [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.
#define lua_number2str(s,n)sprintf((s),"%.14g",(n))
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:203:1:  [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[60];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:680:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:697:1:  [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];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:698:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:707:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:745:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:753:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:756:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:760:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:1295:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:2571:1:  [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[60];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:2711:1:  [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[80];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:4702:1:  [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[32];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:4905:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:5866:1:  [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[BUFSIZ];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6102:1:  [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);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6121:1:  [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];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6154:6:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6699:5:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6715:5:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6753:5:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7594:1:  [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[(sizeof("-+ #0")+sizeof("l")+10)];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7595:1:  [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[512];
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7726:1:  [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[8];
data/luajit-2.1.0~beta3+dfsg/src/lauxlib.h:139: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/luajit-2.1.0~beta3+dfsg/src/lib_aux.c:243: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/luajit-2.1.0~beta3+dfsg/src/lib_debug.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[5];
data/luajit-2.1.0~beta3+dfsg/src/lib_debug.c:365: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/luajit-2.1.0~beta3+dfsg/src/lib_ffi.c:709: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(dp, sp, len);
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:87: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).
  iof->fp = fopen(fname, mode);
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:261: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(L->top, &fn->c.upvalue[1], n*sizeof(TValue));
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:403: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).
  iof->fp = fopen(fname, mode);
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:433:13:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  iof->fp = tmpfile();
data/luajit-2.1.0~beta3+dfsg/src/lib_os.c:84: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 buf[15+1];
data/luajit-2.1.0~beta3+dfsg/src/lib_os.c:86:3:  [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(buf, "/tmp/lua_XXXXXX");
data/luajit-2.1.0~beta3+dfsg/src/lib_os.c:87:8:  [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).
  fp = mkstemp(buf);
data/luajit-2.1.0~beta3+dfsg/src/lib_os.c:93: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 buf[L_tmpnam];
data/luajit-2.1.0~beta3+dfsg/src/lib_package.c:83: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/luajit-2.1.0~beta3+dfsg/src/lib_package.c:100:3:  [2] (buffer) wchar_t:
  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.
  wchar_t wbuffer[128];
data/luajit-2.1.0~beta3+dfsg/src/lib_package.c:101: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*2];
data/luajit-2.1.0~beta3+dfsg/src/lib_package.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 buffer[128];
data/luajit-2.1.0~beta3+dfsg/src/lib_package.c:272: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/luajit-2.1.0~beta3+dfsg/src/lib_string.c:196: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 match_class_map[32] = {
data/luajit-2.1.0~beta3+dfsg/src/lj_alloc.c:239:12:  [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).
  int fd = open("/dev/urandom", O_RDONLY);
data/luajit-2.1.0~beta3+dfsg/src/lj_alloc.c:1469: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(newmem, ptr, oc < nsize ? oc : nsize);
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:208: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 ra_dbg_buf[65536];
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:233:8:  [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.
  p += sprintf(p, "%08x  \e[36m%04d ", (uintptr_t)as->mcp, as->curins-REF_BIAS);
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:237: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, fmt, (size_t)(e-fmt));
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:256:7:  [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.
	p += sprintf(p, "%04d", ref - REF_BIAS);
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:258:7:  [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.
	p += sprintf(p, "K%03d", REF_BIAS - ref);
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:261:12:  [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.
      p += sprintf(p, "[sp+0x%x]", sps_scale(slot));
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:263:12:  [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.
      p += sprintf(p, "%08x", va_arg(argp, int32_t));
data/luajit-2.1.0~beta3+dfsg/src/lj_asm.c:2372: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(J->curfinal->ir + as->orignins, T->ir + as->orignins,
data/luajit-2.1.0~beta3+dfsg/src/lj_bcread.c:64: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(p, ls->p, n);
data/luajit-2.1.0~beta3+dfsg/src/lj_bcread.c:79: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(sbufP(&ls->sb), buf, sz);
data/luajit-2.1.0~beta3+dfsg/src/lj_bcread.c:116: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(q, bcread_mem(ls, len), len);
data/luajit-2.1.0~beta3+dfsg/src/lj_buf.c:214: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(buf, strdata(s1), len1);
data/luajit-2.1.0~beta3+dfsg/src/lj_buf.c:215: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(buf+len1, strdata(s2), len2);
data/luajit-2.1.0~beta3+dfsg/src/lj_buf.h:75:18:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  return (char *)memcpy(p, q, len) + len;
data/luajit-2.1.0~beta3+dfsg/src/lj_carith.c:236:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    const char *repr[2];
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:50: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(dp, sp, ctr->size);
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:224: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(dp, sp, ctr->size);
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:230:33:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  if (!(ct->info & CTF_VARARG)) memcpy(dp, &cc->fpr[0], ctr->size);
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:307: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(dp, sp, ctr->size); \
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:395: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(dp, sp, ctr->size); \
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.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(dp, sp, ctr->size);  /* Copy complex from GPRs. */
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:649: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(dp, sp, ctr->size);  /* Copy struct return value from GPRs. */
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:767: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(&cc->stack[nsp], dp, n*CTSIZE_PTR);
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:785: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(dp, sp, sz);
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:972: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((uint8_t *)dp + ofs,
data/luajit-2.1.0~beta3+dfsg/src/lj_ccall.c:992: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(dp, sp, ctr->size);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:169: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(dp, sp, ssize);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:174: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(dp + (dsize-ssize), sp, ssize);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:178: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(dp, sp, dsize);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:180: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(dp, sp + (ssize-dsize), dsize);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:315: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(dp, sp, esize);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:361: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(dp, sp, dsize);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:413: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(cdataptr(cd), sp, sz);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:481:40:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      for (; ofs < size; ofs += esize) memcpy(dp + ofs, dp, esize);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:584: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(dp, strdata(str), sz);
data/luajit-2.1.0~beta3+dfsg/src/lj_cconv.c:680:36:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    for (; ofs < sz; ofs += esize) memcpy(dp + ofs, dp, esize);
data/luajit-2.1.0~beta3+dfsg/src/lj_clib.c:97:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *fp = fopen(name, "r");
data/luajit-2.1.0~beta3+dfsg/src/lj_clib.c:100: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 buf[256];
data/luajit-2.1.0~beta3+dfsg/src/lj_clib.c:176:3:  [2] (buffer) wchar_t:
  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.
  wchar_t wbuf[128];
data/luajit-2.1.0~beta3+dfsg/src/lj_clib.c:177: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 buf[128*2];
data/luajit-2.1.0~beta3+dfsg/src/lj_clib.c:182: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 buf[128];
data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.c:161: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(ct, cts->tab, id*sizeof(CType));
data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.c:366: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 buf[CTREPR_MAX];
data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.c:410: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 buf[10];
data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.c:557: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 buf[1+20+3];
data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.h:390: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((cts)->hash, savects_.hash, sizeof(savects_.hash)))
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:336:28:  [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.
      if (((const unsigned char *)src)[len] < ' ') break;
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:341: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, "..."); out += 3;
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:359: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[LUA_IDSIZE];
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.h:22: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];
data/luajit-2.1.0~beta3+dfsg/src/lj_dispatch.c:78: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(GG->got, dispatch_got, LJ_GOT__MAX*sizeof(ASMFunction *));
data/luajit-2.1.0~beta3+dfsg/src/lj_dispatch.c:148: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(&disp[0], &disp[GG_LEN_DDISP], GG_LEN_SDISP*sizeof(ASMFunction));
data/luajit-2.1.0~beta3+dfsg/src/lj_err.c:648: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/luajit-2.1.0~beta3+dfsg/src/lj_gdbjit.c:714: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(&obj->hdr, &elfhdr_template, sizeof(ELFheader));
data/luajit-2.1.0~beta3+dfsg/src/lj_gdbjit.c:754: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(&eo->obj, &ctx->obj, ctx->objsize);  /* Copy ELF object. */
data/luajit-2.1.0~beta3+dfsg/src/lj_ir.c:106: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(newbase + ofs, baseir, (J->cur.nins - J->irbotlim)*sizeof(IRIns));
data/luajit-2.1.0~beta3+dfsg/src/lj_ircall.h:234:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  _(FFI,	memcpy,			3,   S, PTR, 0) \
data/luajit-2.1.0~beta3+dfsg/src/lj_jit.h:199: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(&pcbase, sn, sizeof(uint64_t));
data/luajit-2.1.0~beta3+dfsg/src/lj_lib.c:95: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(fn->c.upvalue, L->top, sizeof(TValue)*nuv);
data/luajit-2.1.0~beta3+dfsg/src/lj_lib.c:126: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(&L->top->n, p, sizeof(double));
data/luajit-2.1.0~beta3+dfsg/src/lj_load.c:72: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 buf[LUAL_BUFFERSIZE];
data/luajit-2.1.0~beta3+dfsg/src/lj_load.c:91:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    ctx.fp = fopen(filename, "rb");
data/luajit-2.1.0~beta3+dfsg/src/lj_obj.h:974:15:  [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.
LJ_DATA const char *const lj_obj_typename[1+LUA_TCDATA+1];
data/luajit-2.1.0~beta3+dfsg/src/lj_obj.h:975:15:  [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.
LJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+1];
data/luajit-2.1.0~beta3+dfsg/src/lj_opt_split.c:336: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(oir, IR(nk), irlen*sizeof(IRIns));
data/luajit-2.1.0~beta3+dfsg/src/lj_parse.c:1394: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(uv, fs->uvtmp, fs->nuv*sizeof(VarIndex));
data/luajit-2.1.0~beta3+dfsg/src/lj_parse.c:1485: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(p, sbufB(&ls->sb), sbuflen(&ls->sb));  /* Copy from temp. buffer. */
data/luajit-2.1.0~beta3+dfsg/src/lj_record.c:1924: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(&J->L->base[topslot-1], savetv, sizeof(savetv));  /* Restore slots. */
data/luajit-2.1.0~beta3+dfsg/src/lj_record.c:1949: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(&pcbase, flink, sizeof(uint64_t));
data/luajit-2.1.0~beta3+dfsg/src/lj_record.c:1951: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(flink, &pcbase, sizeof(uint64_t));
data/luajit-2.1.0~beta3+dfsg/src/lj_snap.c:114: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(map, &pcbase, sizeof(uint64_t));
data/luajit-2.1.0~beta3+dfsg/src/lj_str.c:180: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(strdatawr(s), str, len);
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c:258: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 buf[STRFMT_MAXBUF_XINT], *q = buf + sizeof(buf), *p;
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c:354: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 buf[STRFMT_MAXBUF_INT];
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c:369: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 buf[1];
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c:389: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 buf[8+2+2+16], *p = buf;
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt_num.c:249: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 nd9[9], ref9[9];
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt_num.c:447:4:  [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 tail[9];
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt_num.c:517:4:  [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 tail[9];
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt_num.c:588: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 buf[STRFMT_MAXBUF_NUM];
data/luajit-2.1.0~beta3+dfsg/src/lj_tab.c:199: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(array, karray, asize*sizeof(TValue));
data/luajit-2.1.0~beta3+dfsg/src/lj_target.h:156:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  return (char *)group[exitno / EXITSTUBS_PER_GROUP] +
data/luajit-2.1.0~beta3+dfsg/src/lj_trace.c:82: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(p, J->cur.field, J->cur.szfield*sizeof(tp)); \
data/luajit-2.1.0~beta3+dfsg/src/lj_trace.c:110: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 fname[40];
data/luajit-2.1.0~beta3+dfsg/src/lj_trace.c:111: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(fname, "/tmp/perf-%d.map", getpid());
data/luajit-2.1.0~beta3+dfsg/src/lj_trace.c:112:16:  [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).
    if (!(fp = fopen(fname, "w"))) return;
data/luajit-2.1.0~beta3+dfsg/src/lj_trace.c:138: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(p, T->ir + T->nk, szins);
data/luajit-2.1.0~beta3+dfsg/src/lj_trace.c:148: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(T, &J->cur, sizeof(GCtrace));
data/luajit-2.1.0~beta3+dfsg/src/lua.h:370: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/luajit-2.1.0~beta3+dfsg/src/luajit.c:212: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 buf[LUA_MAXINPUT];
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:122: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).
  p = (char *)malloc(strlen(name)+1);  /* MSVC doesn't like strdup. */
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm.c:224: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).
    int len = (int)strlen(gl);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_fold.c:217:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	buf[strlen(buf)-1] = '\0';
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:29: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 n = strlen(p);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:89: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).
  modnamelen = strlen(p);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:138: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(p) > sizeof(funcname)-1) {
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:219: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).
    p += strlen(p)+1;
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:221: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 (p+strlen(name)+1 >= (char *)obuf+sizeof(obuf)) {
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:266: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).
    int len = (int)strlen(p);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:404: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 n, len = strlen(ldh->suffix);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:416:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	  buf[strlen(buf)-1] = '\0';
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_lib.c:452:12:  [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 += strlen(p)+1;
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:134: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(name);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:224:56:  [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).
  sofs += (pesect[PEOBJ_SECT_RDATA_Z].size = (uint32_t)strlen(ctx->dasm_ident)+1);
data/luajit-2.1.0~beta3+dfsg/src/host/buildvm_peobj.c:340: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).
  owrite(ctx, ctx->dasm_ident, strlen(ctx->dasm_ident)+1);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:592:40:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:733:1:  [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);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:741:3:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:742:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:755:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:4823:12:  [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);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:5540: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).
lua_pushlstring(L,s,strlen(s));
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:5960: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).
*len=(def?strlen(def):0);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6035: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).
if(e==NULL)e=fname+strlen(fname);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6157:3:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
c=getc(lf.f);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6160:10:  [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');
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6161:14:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6166:10:  [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!="\033Lua"[0]);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6772:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
int c=getc(f);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:6787:3:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7568:1:  [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/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7574: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_t l=strlen(form);
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7576:1:  [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(form+l-1,"l");
data/luajit-2.1.0~beta3+dfsg/src/host/minilua.c:7641: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,buff,strlen(buff));
data/luajit-2.1.0~beta3+dfsg/src/lib_aux.c:88: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/luajit-2.1.0~beta3+dfsg/src/lib_aux.c:165: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/luajit-2.1.0~beta3+dfsg/src/lib_aux.c:227: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/luajit-2.1.0~beta3+dfsg/src/lib_debug.c:370: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/luajit-2.1.0~beta3+dfsg/src/lib_ffi.c:691: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).
    len = strlen(p);
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:152:17:  [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).
    n += (MSize)strlen(buf+n);
data/luajit-2.1.0~beta3+dfsg/src/lib_io.c:185:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int c = getc(fp);
data/luajit-2.1.0~beta3+dfsg/src/lib_package.c:284: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/luajit-2.1.0~beta3+dfsg/src/lj_alloc.c:241:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int ok = ((size_t)read(fd, &val, sizeof(val)) == sizeof(val));
data/luajit-2.1.0~beta3+dfsg/src/lj_api.c:536: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).
    if (len != NULL) *len = def ? strlen(def) : 0;
data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.c:437: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).
  ctype_prepstr(ctr, t, (MSize)strlen(t));
data/luajit-2.1.0~beta3+dfsg/src/lj_ctype.c:610: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(name);
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:323:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(out, src+1, LUA_IDSIZE);  /* Remove first char. */
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:340:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(out, src, len); out += len;
data/luajit-2.1.0~beta3+dfsg/src/lj_debug.c:605:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	    lj_buf_putmem(sb, name, (MSize)strlen(name));
data/luajit-2.1.0~beta3+dfsg/src/lj_ircall.h:233: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).
  _(FFI,	strlen,			1,   L, INTP, 0) \
data/luajit-2.1.0~beta3+dfsg/src/lj_load.c:154: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/luajit-2.1.0~beta3+dfsg/src/lj_str.h:24:45:  [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 lj_str_newz(L, s)	(lj_str_new(L, s, strlen(s)))
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c:390:47:  [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 = lj_buf_wmem(p, lj_typename(o), (MSize)strlen(lj_typename(o)));
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c:422: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).
  lj_strfmt_init(&fs, fmt, (MSize)strlen(fmt));
data/luajit-2.1.0~beta3+dfsg/src/lj_strfmt.c:440: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).
      lj_buf_putmem(sb, s, (MSize)strlen(s));
data/luajit-2.1.0~beta3+dfsg/src/luajit.c:174: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/luajit-2.1.0~beta3+dfsg/src/luajit.c:215: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).
    size_t len = strlen(buf);
data/luajit-2.1.0~beta3+dfsg/src/luajit.c:347:55:  [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, cmd, opt ? (size_t)(opt - cmd) : strlen(cmd));

ANALYSIS SUMMARY:

Hits = 249
Lines analyzed = 83443 in approximately 2.31 seconds (36061 lines/second)
Physical Source Lines of Code (SLOC) = 70776
Hits@level = [0] 164 [1]  58 [2] 161 [3]   6 [4]  24 [5]   0
Hits@level+ = [0+] 413 [1+] 249 [2+] 191 [3+]  30 [4+]  24 [5+]   0
Hits/KSLOC@level+ = [0+] 5.83531 [1+] 3.51814 [2+] 2.69865 [3+] 0.423872 [4+] 0.339098 [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.