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/mruby-2.0.0/examples/mrbgems/c_and_ruby_extension_example/src/example.c
Examining data/mruby-2.0.0/examples/mrbgems/c_extension_example/src/example.c
Examining data/mruby-2.0.0/examples/mrbgems/c_extension_example/test/example.c
Examining data/mruby-2.0.0/include/mrbconf.h
Examining data/mruby-2.0.0/include/mruby.h
Examining data/mruby-2.0.0/include/mruby/array.h
Examining data/mruby-2.0.0/include/mruby/boxing_nan.h
Examining data/mruby-2.0.0/include/mruby/boxing_no.h
Examining data/mruby-2.0.0/include/mruby/boxing_word.h
Examining data/mruby-2.0.0/include/mruby/class.h
Examining data/mruby-2.0.0/include/mruby/common.h
Examining data/mruby-2.0.0/include/mruby/compile.h
Examining data/mruby-2.0.0/include/mruby/data.h
Examining data/mruby-2.0.0/include/mruby/debug.h
Examining data/mruby-2.0.0/include/mruby/dump.h
Examining data/mruby-2.0.0/include/mruby/error.h
Examining data/mruby-2.0.0/include/mruby/gc.h
Examining data/mruby-2.0.0/include/mruby/hash.h
Examining data/mruby-2.0.0/include/mruby/irep.h
Examining data/mruby-2.0.0/include/mruby/istruct.h
Examining data/mruby-2.0.0/include/mruby/khash.h
Examining data/mruby-2.0.0/include/mruby/numeric.h
Examining data/mruby-2.0.0/include/mruby/object.h
Examining data/mruby-2.0.0/include/mruby/opcode.h
Examining data/mruby-2.0.0/include/mruby/ops.h
Examining data/mruby-2.0.0/include/mruby/proc.h
Examining data/mruby-2.0.0/include/mruby/range.h
Examining data/mruby-2.0.0/include/mruby/re.h
Examining data/mruby-2.0.0/include/mruby/string.h
Examining data/mruby-2.0.0/include/mruby/throw.h
Examining data/mruby-2.0.0/include/mruby/value.h
Examining data/mruby-2.0.0/include/mruby/variable.h
Examining data/mruby-2.0.0/include/mruby/version.h
Examining data/mruby-2.0.0/mrbgems/mruby-array-ext/src/array.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.h
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.h
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.h
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h
Examining data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdberror.h
Examining data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
Examining data/mruby-2.0.0/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c
Examining data/mruby-2.0.0/mrbgems/mruby-class-ext/src/class.c
Examining data/mruby-2.0.0/mrbgems/mruby-compiler/core/codegen.c
Examining data/mruby-2.0.0/mrbgems/mruby-compiler/core/node.h
Examining data/mruby-2.0.0/mrbgems/mruby-error/src/exception.c
Examining data/mruby-2.0.0/mrbgems/mruby-error/test/exception.c
Examining data/mruby-2.0.0/mrbgems/mruby-eval/src/eval.c
Examining data/mruby-2.0.0/mrbgems/mruby-exit/src/mruby-exit.c
Examining data/mruby-2.0.0/mrbgems/mruby-fiber/src/fiber.c
Examining data/mruby-2.0.0/mrbgems/mruby-hash-ext/src/hash-ext.c
Examining data/mruby-2.0.0/mrbgems/mruby-inline-struct/test/inline.c
Examining data/mruby-2.0.0/mrbgems/mruby-io/include/mruby/ext/io.h
Examining data/mruby-2.0.0/mrbgems/mruby-io/src/file.c
Examining data/mruby-2.0.0/mrbgems/mruby-io/src/file_test.c
Examining data/mruby-2.0.0/mrbgems/mruby-io/src/io.c
Examining data/mruby-2.0.0/mrbgems/mruby-io/src/mruby_io_gem.c
Examining data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c
Examining data/mruby-2.0.0/mrbgems/mruby-kernel-ext/src/kernel.c
Examining data/mruby-2.0.0/mrbgems/mruby-math/src/math.c
Examining data/mruby-2.0.0/mrbgems/mruby-metaprog/src/metaprog.c
Examining data/mruby-2.0.0/mrbgems/mruby-method/src/method.c
Examining data/mruby-2.0.0/mrbgems/mruby-numeric-ext/src/numeric_ext.c
Examining data/mruby-2.0.0/mrbgems/mruby-object-ext/src/object.c
Examining data/mruby-2.0.0/mrbgems/mruby-objectspace/src/mruby_objectspace.c
Examining data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c
Examining data/mruby-2.0.0/mrbgems/mruby-print/src/print.c
Examining data/mruby-2.0.0/mrbgems/mruby-proc-ext/src/proc.c
Examining data/mruby-2.0.0/mrbgems/mruby-proc-ext/test/proc.c
Examining data/mruby-2.0.0/mrbgems/mruby-random/src/mt19937ar.c
Examining data/mruby-2.0.0/mrbgems/mruby-random/src/mt19937ar.h
Examining data/mruby-2.0.0/mrbgems/mruby-random/src/random.c
Examining data/mruby-2.0.0/mrbgems/mruby-random/src/random.h
Examining data/mruby-2.0.0/mrbgems/mruby-range-ext/src/range.c
Examining data/mruby-2.0.0/mrbgems/mruby-sleep/src/mrb_sleep.c
Examining data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c
Examining data/mruby-2.0.0/mrbgems/mruby-socket/test/sockettest.c
Examining data/mruby-2.0.0/mrbgems/mruby-sprintf/src/kernel.c
Examining data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c
Examining data/mruby-2.0.0/mrbgems/mruby-string-ext/src/string.c
Examining data/mruby-2.0.0/mrbgems/mruby-struct/src/struct.c
Examining data/mruby-2.0.0/mrbgems/mruby-symbol-ext/src/symbol.c
Examining data/mruby-2.0.0/mrbgems/mruby-test/driver.c
Examining data/mruby-2.0.0/mrbgems/mruby-test/init_mrbtest.c
Examining data/mruby-2.0.0/mrbgems/mruby-time/src/time.c
Examining data/mruby-2.0.0/mrblib/init_mrblib.c
Examining data/mruby-2.0.0/src/array.c
Examining data/mruby-2.0.0/src/backtrace.c
Examining data/mruby-2.0.0/src/class.c
Examining data/mruby-2.0.0/src/codedump.c
Examining data/mruby-2.0.0/src/compar.c
Examining data/mruby-2.0.0/src/crc.c
Examining data/mruby-2.0.0/src/debug.c
Examining data/mruby-2.0.0/src/dump.c
Examining data/mruby-2.0.0/src/enum.c
Examining data/mruby-2.0.0/src/error.c
Examining data/mruby-2.0.0/src/error.h
Examining data/mruby-2.0.0/src/etc.c
Examining data/mruby-2.0.0/src/fmt_fp.c
Examining data/mruby-2.0.0/src/gc.c
Examining data/mruby-2.0.0/src/hash.c
Examining data/mruby-2.0.0/src/init.c
Examining data/mruby-2.0.0/src/kernel.c
Examining data/mruby-2.0.0/src/load.c
Examining data/mruby-2.0.0/src/numeric.c
Examining data/mruby-2.0.0/src/object.c
Examining data/mruby-2.0.0/src/opcode.h
Examining data/mruby-2.0.0/src/pool.c
Examining data/mruby-2.0.0/src/print.c
Examining data/mruby-2.0.0/src/proc.c
Examining data/mruby-2.0.0/src/range.c
Examining data/mruby-2.0.0/src/state.c
Examining data/mruby-2.0.0/src/string.c
Examining data/mruby-2.0.0/src/symbol.c
Examining data/mruby-2.0.0/src/value_array.h
Examining data/mruby-2.0.0/src/variable.c
Examining data/mruby-2.0.0/src/version.c
Examining data/mruby-2.0.0/src/vm.c

FINAL RESULTS:

data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:44:23:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
  #define CHMOD(a, b) chmod(a,b)
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:449:16:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
  while ((rc = readlink(tmp, buf, bufsize)) == (ssize_t)bufsize && rc != -1) {
data/mruby-2.0.0/include/mruby/value.h:82:10:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
# define vsnprintf(s, n, format, arg) mrb_msvc_vsnprintf(s, n, format, arg)
data/mruby-2.0.0/include/mruby/value.h:83:10:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
# define snprintf(s, n, format, ...) mrb_msvc_snprintf(s, n, format, __VA_ARGS__)
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:55:5:  [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(path, dir);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:58:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
  strcat(path, base);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:101: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(file->path, filename);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:155:7:  [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(found_newline ? "%s\n" : "%s", buf);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:113:7:  [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(BREAK_ERR_MSG_INVALIDBPNO, ps);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:118:7:  [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(BREAK_ERR_MSG_NOBPNO, bpno);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:142:7:  [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(BREAK_ERR_MSG_INVALIDSTR, args);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:162:5:  [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(BREAK_INFO_MSG_LINEBREAK,
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:167:7:  [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(BREAK_INFO_MSG_METHODBREAK_NOCLASS,
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:171:7:  [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(BREAK_INFO_MSG_METHODBREAK,
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:229:7:  [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(BREAK_ERR_MSG_NOBPNO_INFO, bpno);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:265:7:  [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(BREAK_ERR_MSG_INVALIDSTR, args);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:292:11:  [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(BREAK_ERR_MSG_INVALIDMETHOD, args);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:301:13:  [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(BREAK_ERR_MSG_INVALIDMETHOD, body);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:311:11:  [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(BREAK_ERR_MSG_INVALIDCLASS, args);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:350:7:  [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(BREAK_SET_MSG_LINE, ret, file, line);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:353:7:  [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(BREAK_SET_MSG_METHOD, ret, method);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:356:7:  [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(BREAK_SET_MSG_CLASS_METHOD, ret, cname, method);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:362:9:  [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(BREAK_ERR_MSG_INVALIDLINENO, line, file);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:365:9:  [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(BREAK_ERR_MSG_INVALIDFILE, file);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:262:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
  strcat(s, ext);
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:556: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(last_code_line, line);
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:568:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(ruby_code, last_code_line);
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:574: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(ruby_code, last_code_line);
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:253:3:  [4] (shell) execl:
  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.
  execl("/bin/sh", "sh", "-c", pname, (char *)NULL);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:868:11:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
          snprintf(nbuf, sizeof(nbuf), "%" MRB_PRId, v);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:888:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(++s, sizeof(nbuf)-1, "%" MRB_PRIo, v);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:891:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(++s, sizeof(nbuf)-1, "%" MRB_PRIx, v);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:1073:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        n = snprintf(&buf[blen], need, fbuf, fval);
data/mruby-2.0.0/src/fmt_fp.c:384:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf(buf, sizeof(buf), fmt, mrb_float(flo));
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:69: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 *home = getenv("HOME");
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:73: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.
    home = getenv("USERPROFILE");
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:37:11:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
  #define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:253:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
  if (realpath(cpath, RSTRING_PTR(result)) == NULL) {
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:295: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.
    home = getenv("HOME");
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:320: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.
    home = getenv("USERPROFILE");
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:377:10:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
    if (!CreateProcess(
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:377:10:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
    if (!CreateProcess(
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:111:31:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  return mrb_random_rand(mrb, random);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:118:32:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  return mrb_random_srand(mrb, random);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:209:30:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    mrb_get_args(mrb, "|d", &random, &mt_state_type);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:214:31:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    mrb_random_rand_seed(mrb, random);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:224:46:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
      j = mrb_fixnum(mrb_random_mt_rand(mrb, random, mrb_fixnum_value(RARRAY_LEN(ary))));
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:274:42:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_get_args(mrb, "|i?d", &n, &given, &random, &mt_state_type);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:278:29:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_random_rand_seed(mrb, random);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:279:11:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mt_rand(random);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:288:38:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
      return RARRAY_PTR(ary)[mt_rand(random) % len];
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:303:21:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        r = mt_rand(random) % len;
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:324:18:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  struct RClass *random;
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:331:23:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  MRB_SET_INSTANCE_TT(random, MRB_TT_DATA);
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:332:32:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_define_class_method(mrb, random, "rand", mrb_random_g_rand, MRB_ARGS_OPT(1));
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:333:32:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_define_class_method(mrb, random, "srand", mrb_random_g_srand, MRB_ARGS_OPT(1));
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:335:26:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_define_method(mrb, random, "initialize", mrb_random_init, MRB_ARGS_OPT(1));
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:336:26:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_define_method(mrb, random, "rand", mrb_random_rand, MRB_ARGS_OPT(1));
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:337:26:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_define_method(mrb, random, "srand", mrb_random_srand, MRB_ARGS_OPT(1));
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:343:36:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  mrb_const_set(mrb, mrb_obj_value(random), mrb_intern_lit(mrb, "DEFAULT"),
data/mruby-2.0.0/mrbgems/mruby-random/src/random.c:344:28:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
          mrb_obj_new(mrb, random, 0, NULL));
data/mruby-2.0.0/include/mruby.h:1256:8:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#undef memcpy
data/mruby-2.0.0/include/mruby.h:1267: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.
#define memcpy(a,b,c) mrbmemcpy(a,b,c)
data/mruby-2.0.0/include/mruby/compile.h:138: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[MRB_PARSER_TOKBUF_SIZE];
data/mruby-2.0.0/include/mruby/istruct.h:24: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 inline_data[ISTRUCT_DATA_SIZE];
data/mruby-2.0.0/include/mruby/istruct.h:42: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(ISTRUCT_PTR(dest), ISTRUCT_PTR(src), ISTRUCT_DATA_SIZE);
data/mruby-2.0.0/include/mruby/string.h:33: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 ary[RSTRING_EMBED_LEN_MAX + 1];
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:282: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(bp, dbg->bp, sizeof(mrb_debug_breakpoint) * get_size);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:331: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(&dbg->bp[i], &dbg->bp[i + 1], sizeof(mrb_debug_breakpoint));
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:92: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(filename, "rb");
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:140: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[LINE_BUF_SIZE];
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:176: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.
  const char *search_path[3];
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:196:15:  [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(path, "rb")) == NULL) {
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:164:24:  [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).
  if (p != *sp && (i = atoi(*sp)) >= 0) {
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:115:11:  [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, item, buflen);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:127:11:  [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(args->srcpath + srcpathlen + 1, item, itemlen + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:155:19:  [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).
      args->rfp = fopen(argv[0], args->mrbfile ? "rb" : "r");
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:165: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(args->argv, argv, (argc+1) * sizeof(char*));
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:276:5:  [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(mrdb->command, "quit");
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h:137: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 *words[MAX_COMMAND_WORD];
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:253: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, item, buflen);
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:315:19:  [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).
      args->rfp = fopen(argv[0], "r");
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:324: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(args->argv, argv, (argc+1) * sizeof(char*));
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c: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 ruby_code[4096] = { 0 };
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:413: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 last_code_line[1024] = { 0 };
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:476:17:  [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 *lfp = fopen(args.libv[i], "r");
data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c:61: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(outfile, infile, infilelen + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c:65: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, ext, extlen + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c:187: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(fn, "r");
data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c:214:19:  [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 ((infile = fopen(input, "r")) == NULL) {
data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c:312:21:  [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 ((wfp = fopen(args.outfile, "wb")) == NULL) {
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:65: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, item, buflen);
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:118:11:  [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(args->cmdline + cmdlinelen + 1, item, itemlen + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:168:19:  [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).
      args->rfp = fopen(argv[0], args->mrbfile ? "rb" : "r");
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:179: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(args->argv, argv, (argc+1) * sizeof(char*));
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:259:19:  [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 *lfp = fopen(args.libv[i], args.mrbfile ? "rb" : "r");
data/mruby-2.0.0/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c:71: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).
    rfile = fopen(filename, "rb");
data/mruby-2.0.0/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c:89: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).
    wfile = fopen(filename, "wb");
data/mruby-2.0.0/mrbgems/mruby-compiler/core/codegen.c:924: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(name2, name, (size_t)len);
data/mruby-2.0.0/mrbgems/mruby-compiler/core/codegen.c:2353: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 buf[3];
data/mruby-2.0.0/mrbgems/mruby-inline-struct/test/inline.c:67: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(ptr, "mutate", 6);
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:160: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 dname[_MAX_DIR], vname[_MAX_DRIVE];
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:161: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[_MAX_DRIVE + _MAX_DIR];
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:201: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 bname[_MAX_DIR];
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:202: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 extname[_MAX_EXT];
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:205: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[_MAX_DIR + _MAX_EXT];
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:266: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[MAXPATHLEN], *utf8;
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:26:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  #define open  _open
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:774:8:  [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).
  fd = open(fname, (int)flags, (fmode_t)mode);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:18:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
#define open _open
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:25:1:  [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).
mkstemp(char *p)
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:31:8:  [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).
  fd = open(fname, O_RDWR | O_CREAT | O_EXCL, _S_IREAD | _S_IWRITE);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:83:9:  [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).
  fd0 = mkstemp(rfname);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:84:9:  [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).
  fd1 = mkstemp(wfname);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:93:9:  [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).
  fd2 = mkstemp(symlinkname);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:94:9:  [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).
  fd3 = mkstemp(socketname);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:108:8:  [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(rfname, "wb");
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:116:8:  [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(wfname, "wb");
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:67: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.
static unsigned char base64_dec_tab[128];
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:200: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 msg[60];
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:270: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 msg[60];
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:321: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(RSTRING_PTR(str) + sidx, buffer, 8);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:325: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(RSTRING_PTR(str) + sidx, buffer, 8);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:349: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(buffer, src, 8);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:353: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(buffer, src, 8);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:380: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(RSTRING_PTR(str) + sidx, buffer, 4);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:384: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(RSTRING_PTR(str) + sidx, buffer, 4);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:408: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(buffer, src, 4);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:412: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(buffer, src, 4);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:428: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 utf8[4];
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:471: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(RSTRING_PTR(str) + sidx, utf8, len);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:579: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(dptr, sptr, copylen);
data/mruby-2.0.0/mrbgems/mruby-pack/src/pack.c:787:12:  [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.
  unsigned char c, ch[4];
data/mruby-2.0.0/mrbgems/mruby-print/src/print.c:24:18:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
      int wlen = MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, NULL, 0);
data/mruby-2.0.0/mrbgems/mruby-print/src/print.c:27:11:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
      if (MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, utf16, wlen) > 0) {
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:71: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(&in.sin_addr, src, sizeof(struct in_addr));
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:81: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(&in.sin6_addr, src, sizeof(struct in_addr6));
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:106:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(dst, res->ai_addr, res->ai_addrlen);
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:338: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 opt[8];
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:517: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 *addr, buf[50];
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:531: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 *bp, buf[50];
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:536: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, bp, n);
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:712: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(sunp->sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
data/mruby-2.0.0/mrbgems/mruby-socket/test/sockettest.c:15:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
#define open  _open
data/mruby-2.0.0/mrbgems/mruby-socket/test/sockettest.c:20:1:  [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).
mkstemp(char *p)
data/mruby-2.0.0/mrbgems/mruby-socket/test/sockettest.c:26:8:  [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).
  fd = open(fname, O_RDWR | O_CREAT | O_EXCL, _S_IREAD | _S_IWRITE);
data/mruby-2.0.0/mrbgems/mruby-socket/test/sockettest.c:43:12:  [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).
  int fd = mkstemp(name);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:78: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[66], *b = buf + sizeof buf;
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:132: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[blen], s, l);\
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:713:13:  [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/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:797: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 nbuf[68], *s;
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:1008: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 fbuf[32];
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:1040:13:  [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[blen - need], expr, elen);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:1045:13:  [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[blen - elen], expr, elen);
data/mruby-2.0.0/mrbgems/mruby-string-ext/src/string.c:259: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 ch[2];
data/mruby-2.0.0/mrbgems/mruby-string-ext/src/string.c:856: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 utf8[4];
data/mruby-2.0.0/mrbgems/mruby-string-ext/src/string.c:979: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(RSTRING_PTR(self), RSTRING_PTR(result), l);
data/mruby-2.0.0/mrbgems/mruby-string-ext/src/string.c:994:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char utf8len_codepage_zero[256] =
data/mruby-2.0.0/mrbgems/mruby-struct/src/struct.c:136: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, name, (size_t)len);
data/mruby-2.0.0/mrbgems/mruby-time/src/time.c:177: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.
  const char name[8];
data/mruby-2.0.0/mrbgems/mruby-time/src/time.c:188:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char mon_names[12][4] = {
data/mruby-2.0.0/mrbgems/mruby-time/src/time.c:192:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char wday_names[7][4] = {
data/mruby-2.0.0/mrbgems/mruby-time/src/time.c:568: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[32];
data/mruby-2.0.0/mrbgems/mruby-time/src/time.c:573: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];
data/mruby-2.0.0/src/dump.c:87: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(cur, irep->iseq, irep->ilen * sizeof(mrb_code));
data/mruby-2.0.0/src/dump.c:189: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(cur, char_ptr, (size_t)len);
data/mruby-2.0.0/src/dump.c:235: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(cur, name, len); /* symbol name */
data/mruby-2.0.0/src/dump.c:313: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(bin, &footer, sizeof(struct rite_binary_footer));
data/mruby-2.0.0/src/dump.c:533: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(cur, sym, sym_len);
data/mruby-2.0.0/src/dump.c:586: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(cur, str, str_len);
data/mruby-2.0.0/src/fmt_fp.c:68: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 pad[PAD_SIZE];
data/mruby-2.0.0/src/fmt_fp.c:77:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char xdigits[16] = {
data/mruby-2.0.0/src/fmt_fp.c:92: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.
typedef char compiler_defines_long_double_incorrectly[9-(int)sizeof(long double)];
data/mruby-2.0.0/src/fmt_fp.c:104: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[9+LDBL_MANT_DIG/4], *s;
data/mruby-2.0.0/src/fmt_fp.c:107: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 ebuf0[3*sizeof(int)], *ebuf=&ebuf0[3*sizeof(int)], *estr;
data/mruby-2.0.0/src/fmt_fp.c:382:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[25];
data/mruby-2.0.0/src/load.c:88: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(irep->iseq, src, data_len);
data/mruby-2.0.0/src/numeric.c:1279: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[MRB_INT_BIT+1];
data/mruby-2.0.0/src/pool.c:187:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(np, p, oldlen);
data/mruby-2.0.0/src/state.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 buf[1];
data/mruby-2.0.0/src/state.c:208: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(ns->as.ary, ptr, len);
data/mruby-2.0.0/src/state.c:217: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(ns->as.heap.ptr, ptr, len);
data/mruby-2.0.0/src/string.c:66: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(s->as.ary, p, len);
data/mruby-2.0.0/src/string.c:77: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(s->as.heap.ptr, p, len);
data/mruby-2.0.0/src/string.c:140: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(tmp, s->as.ary, len);
data/mruby-2.0.0/src/string.c:215:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char utf8len_codepage[256] =
data/mruby-2.0.0/src/string.c:526: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(s1->as.ary, RSTR_PTR(s2), len);
data/mruby-2.0.0/src/string.c:594:13:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  wcssize = MultiByteToWideChar(GetACP(), 0, str, len,  NULL, 0);
data/mruby-2.0.0/src/string.c:598:13:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  wcssize = MultiByteToWideChar(GetACP(), 0, str, len, wcsp, wcssize + 1);
data/mruby-2.0.0/src/string.c:624:13:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  wcssize = MultiByteToWideChar(CP_UTF8, 0, utf8, len,  NULL, 0);
data/mruby-2.0.0/src/string.c:628:13:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  wcssize = MultiByteToWideChar(CP_UTF8, 0, utf8, len, wcsp, wcssize + 1);
data/mruby-2.0.0/src/string.c:674: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(ptr, p, len);
data/mruby-2.0.0/src/string.c:698: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(RSTR_PTR(s), p, len);
data/mruby-2.0.0/src/string.c:769: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(RSTR_PTR(t), RSTR_PTR(s), RSTR_LEN(s));
data/mruby-2.0.0/src/string.c:770: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(RSTR_PTR(t) + RSTR_LEN(s), RSTR_PTR(s2), RSTR_LEN(s2));
data/mruby-2.0.0/src/string.c:845: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, RSTRING_PTR(self), n);
data/mruby-2.0.0/src/string.c:847: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 + n, p, n);
data/mruby-2.0.0/src/string.c:850: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 + n, p, len-n);
data/mruby-2.0.0/src/string.c:1726: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(buf, RSTRING_PTR(str), len);
data/mruby-2.0.0/src/string.c:1732: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(r, p, clen);
data/mruby-2.0.0/src/string.c:2249: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[DBL_DIG * 4 + 10];
data/mruby-2.0.0/src/string.c:2576: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(RSTR_PTR(s) + RSTR_LEN(s), ptr, len);
data/mruby-2.0.0/src/string.c:2622: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[CHAR_ESC_LEN + 1];
data/mruby-2.0.0/src/symbol.c:82: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, name, len);
data/mruby-2.0.0/src/symbol.c:410: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(sp+1, name, len);
data/mruby-2.0.0/src/variable.c:968: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[3];
data/mruby-2.0.0/src/vm.c:882: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 kind_str[3][7] = { "return", "break", "yield" };
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:196: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).
  set_file = (char*)mrb_malloc(mrb, strlen(file) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:206:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(set_file, file, strlen(file) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:206:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  strncpy(set_file, file, strlen(file) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:233: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).
    set_class = (char*)mrb_malloc(mrb, strlen(class_name) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:234:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(set_class, class_name, strlen(class_name) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:234: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).
    strncpy(set_class, class_name, strlen(class_name) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:240:39:  [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).
  set_method = (char*)mrb_malloc(mrb, strlen(method_name) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:242:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(set_method, method_name, strlen(method_name) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c:242: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).
  strncpy(set_method, method_name, strlen(method_name) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:45: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).
  len = strlen(base) + 1;
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:48: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).
    len += strlen(dir) + sizeof("/") - 1;
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:56:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(path, "/");
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:75:42:  [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 = p != NULL ? (size_t)(p - path) : strlen(path);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:78:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(dir, path, len);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:100:39:  [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).
  file->path = (char*)mrb_malloc(mrb, strlen(filename) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:112: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).
  if ((len = strlen(s)) == 0) {
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c:124:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((c = fgetc(fp)) != '\n') {
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:73: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).
  if ((*ps == '0')||(strlen(ps) >= BPNO_LETTER_NUM)) {
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:148:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if ((*args == '0')||(strlen(args) >= LINENO_MAX_DIGIT)) {
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:226: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(*sp);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:231:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(st->filename, *sp, len);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:256: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(filename);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:259: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).
  s = (char*)mrb_malloc(mrb, len + strlen(ext) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:260: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).
  memset(s, '\0', len + strlen(ext) + 1);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:261:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(s, filename, len);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:472:18:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ((buf = getchar()) == EOF) {
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c:477:36:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      while (buf != '\n' && (buf = getchar()) != EOF) ;
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:113: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).
          buflen = strlen(item) + 1;
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:122:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          srcpathlen = strlen(args->srcpath);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:123: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).
          itemlen = strlen(item);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:270:12:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((c=getchar()) == EOF || c == '\n') break;
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:281:16:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    for ( ; (c=getchar()) != EOF && c !='\n'; i++) ;
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:312: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).
    *pp = ps + strlen(ps);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:344: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).
    wlen = strlen(mrdb->words[0]);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:366: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).
      wlen = strlen(mrdb->words[0]);
data/mruby-2.0.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:376: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).
      wlen = strlen(mrdb->words[1]);
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:116: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).
  fwrite(msg, strlen(msg), 1, stdout);
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:251: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).
  size_t buflen = strlen(item) + 1;
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:373: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(word);
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:510:25:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((last_char = getchar()) != '\n') {
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:552: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(line) > sizeof(last_code_line)-2) {
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:557:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(last_code_line, "\n");
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:564: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).
      if (strlen(ruby_code)+strlen(last_code_line) > sizeof(ruby_code)-1) {
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:564: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 (strlen(ruby_code)+strlen(last_code_line) > sizeof(ruby_code)-1) {
data/mruby-2.0.0/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c:587:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    parser->send = utf8 + strlen(utf8);
data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c:58: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).
  infilelen = strlen(infile);
data/mruby-2.0.0/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c:59: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).
  extlen = strlen(ext);
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:63: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).
  size_t buflen = strlen(item) + 1;
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:81: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(*argv) <= 1) {
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:113:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          cmdlinelen = strlen(args->cmdline);
data/mruby-2.0.0/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:114: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).
          itemlen = strlen(item);
data/mruby-2.0.0/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c:34:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const size_t len = strlen(argv[i]);
data/mruby-2.0.0/mrbgems/mruby-compiler/core/codegen.c:1295: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).
  const char *e = p + strlen(p);
data/mruby-2.0.0/mrbgems/mruby-compiler/core/codegen.c:1322: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).
  const char *e = p + strlen(p);
data/mruby-2.0.0/mrbgems/mruby-inline-struct/test/inline.c:15:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(string, "float", size-1);
data/mruby-2.0.0/mrbgems/mruby-inline-struct/test/inline.c:18:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(string, "fixnum", size-1);
data/mruby-2.0.0/mrbgems/mruby-inline-struct/test/inline.c:21:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(string, "string", size-1);
data/mruby-2.0.0/mrbgems/mruby-inline-struct/test/inline.c:24:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(string, "anything", size-1);
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:98:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    omask = umask(0);
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:99:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(omask);
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:101:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    omask = umask(mask);
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:170: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).
  ridx = strlen(buffer);
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:172:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant character.
    strncpy(buffer, ".", 2);  /* null terminated */
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:210: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).
  ridx = strlen(path);
data/mruby-2.0.0/mrbgems/mruby-io/src/file.c:258: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).
  mrb_str_resize(mrb, result, strlen(RSTRING_PTR(result)));
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:30:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  #define read  _read
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:291:95:  [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).
  mrb_value opt = mrb_funcall(mrb, obj, "[]", 1, mrb_symbol_value(mrb_intern_static(mrb, key, strlen(key))));
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:852:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ret = read(fptr->fd, RSTRING_PTR(buf), (fsize_t)maxlen);
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1057:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  mrb_value read, read_io, write, except, timeout, list;
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1093:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (!mrb_nil_p(read)) {
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1094:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    mrb_check_type(mrb, read, MRB_TT_ARRAY);
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1097:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    for (i = 0; i < RARRAY_LEN(read); i++) {
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1098:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      read_io = RARRAY_PTR(read)[i];
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1177:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      for (i = 0; i < RARRAY_LEN(read); i++) {
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1178:49:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        fptr = io_get_open_fptr(mrb, RARRAY_PTR(read)[i]);
data/mruby-2.0.0/mrbgems/mruby-io/src/io.c:1181:46:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
          mrb_ary_push(mrb, list, RARRAY_PTR(read)[i]);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:47:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
#define umask(mode) _umask(mode)
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:82:10:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  mask = umask(077);
data/mruby-2.0.0/mrbgems/mruby-io/test/mruby_io_test.c:100:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  umask(mask);
data/mruby-2.0.0/mrbgems/mruby-method/src/method.c:33:111:  [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).
          mrb_raisef(mrb, E_TYPE_ERROR, "bind argument must be an instance of %S", mrb_str_new_static(mrb, s, strlen(s)));
data/mruby-2.0.0/mrbgems/mruby-method/src/method.c:332: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).
    mrb_str_new_static(mrb, s, strlen(s))
data/mruby-2.0.0/mrbgems/mruby-sleep/src/mrb_sleep.c:32:13:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    #define usleep(x) Sleep((DWORD)((x)<1000) ? 1 : ((x)/1000))
data/mruby-2.0.0/mrbgems/mruby-sleep/src/mrb_sleep.c:51:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(sec * 1000000);
data/mruby-2.0.0/mrbgems/mruby-sleep/src/mrb_sleep.c:95:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(usec);
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:211: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).
  mrb_str_resize(mrb, host, strlen(RSTRING_PTR(host)));
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:213: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).
  mrb_str_resize(mrb, serv, strlen(RSTRING_PTR(serv)));
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:259: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).
  mrb_str_resize(mrb, host, strlen(RSTRING_PTR(host)));
data/mruby-2.0.0/mrbgems/mruby-socket/src/socket.c:599: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).
  mrb_str_resize(mrb, buf, (mrb_int)strlen(RSTRING_PTR(buf)));
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:41: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).
    *t |= EXTENDSIGN(3, strlen(t));
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:885:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(++s, RSTRING_PTR(val), sizeof(nbuf)-1);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:912: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 = strlen(s);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:944: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 = strlen(prefix);
data/mruby-2.0.0/mrbgems/mruby-sprintf/src/sprintf.c:970:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          int plen = (int)strlen(prefix);
data/mruby-2.0.0/mrbgems/mruby-time/src/time.c:571: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).
  len = strlen(s)-1;            /* truncate the last newline */
data/mruby-2.0.0/src/debug.c:157: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).
  fn_len = strlen(filename);
data/mruby-2.0.0/src/string.c:173: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/mruby-2.0.0/src/string.c:593: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).
    len = (int)strlen(str);
data/mruby-2.0.0/src/string.c:623: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).
    len = (int)strlen(utf8);
data/mruby-2.0.0/src/string.c:736: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).
  if ((strlen(RSTR_PTR(s)) ^ RSTR_LEN(s)) != 0) {
data/mruby-2.0.0/src/string.c:2178: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).
  return mrb_str_len_to_inum(mrb, str, strlen(str), base, badcheck);
data/mruby-2.0.0/src/string.c:2586: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).
  return mrb_str_cat(mrb, str, ptr, strlen(ptr));
data/mruby-2.0.0/src/symbol.c:107: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 mrb_intern(mrb, name, strlen(name));
data/mruby-2.0.0/src/symbol.c:137: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).
  return mrb_check_intern(mrb, name, (mrb_int)strlen(name));
data/mruby-2.0.0/src/symbol.c:412:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!symname_p(name) || strlen(name) != (size_t)len) {
data/mruby-2.0.0/src/symbol.c:438:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (symname_p(name) && strlen(name) == (size_t)len) {

ANALYSIS SUMMARY:

Hits = 312
Lines analyzed = 50319 in approximately 1.15 seconds (43570 lines/second)
Physical Source Lines of Code (SLOC) = 37356
Hits@level = [0] 270 [1] 105 [2] 146 [3]  27 [4]  32 [5]   2
Hits@level+ = [0+] 582 [1+] 312 [2+] 207 [3+]  61 [4+]  34 [5+]   2
Hits/KSLOC@level+ = [0+] 15.5798 [1+] 8.35207 [2+] 5.54128 [3+] 1.63294 [4+] 0.910162 [5+] 0.0535389
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.