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/jruby-9.1.17.0/lib/ruby/include/ruby.h
Examining data/jruby-9.1.17.0/samples/ext/mytest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/Benchmark.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/BoolTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/BufferTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/ClosureTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/EnumTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/FunctionTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/GlobalVariable.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/LastErrorTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/NumberTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/PointerTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/ReferenceTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/StringTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/StructTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/UnionTest.c
Examining data/jruby-9.1.17.0/spec/ffi/fixtures/VariadicTest.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/array_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/bignum_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/boolean_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/class_id_under_autoload_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/class_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/class_under_autoload_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/complex_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/constants_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/data_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/encoding_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/enumerator_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/exception_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/file_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/fixnum_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/float_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/gc_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/globals_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/hash_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/integer_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/io_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/jruby.h
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/kernel_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/marshal_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/module_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/module_under_autoload_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/mutex_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/numeric_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/object_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/proc_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/range_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/rational_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/regexp_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/rubinius.h
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/rubyspec.h
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/string_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/struct_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/symbol_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/thread_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/time_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/truffleruby.h
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/typed_data_spec.c
Examining data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/util_spec.c
Examining data/jruby-9.1.17.0/test/jruby/testapp/testapp.c
Examining data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c

FINAL RESULTS:

data/jruby-9.1.17.0/spec/ffi/fixtures/StringTest.c:18: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(s1, s2);
data/jruby-9.1.17.0/spec/ffi/fixtures/StringTest.c:23: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(dst, src);
data/jruby-9.1.17.0/spec/ffi/fixtures/StructTest.c:96: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(t->string, s);
data/jruby-9.1.17.0/spec/ffi/fixtures/StructTest.c:235:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(cp, ss.bytes);
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:569:20:  [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.
  nailgun_server = getenv("NAILGUN_SERVER");
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:575:18:  [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.
  nailgun_port = getenv("NAILGUN_PORT");
data/jruby-9.1.17.0/spec/ffi/fixtures/NumberTest.c:83:44:  [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 pack_f32(buf, v) do { float f = v; memcpy((buf), &f, sizeof(f)); } while(0)
data/jruby-9.1.17.0/spec/ffi/fixtures/NumberTest.c:84:45:  [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 pack_f64(buf, v) do { double f = v; memcpy((buf), &f, sizeof(f)); } while(0)
data/jruby-9.1.17.0/spec/ffi/fixtures/PointerTest.c:23: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((caddr_t) arg1 + offset, &value, sizeof(value)); \
data/jruby-9.1.17.0/spec/ffi/fixtures/StructTest.c:47: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 string[32];
data/jruby-9.1.17.0/spec/ffi/fixtures/VariadicTest.c:48:17:  [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++, &d, sizeof(d));
data/jruby-9.1.17.0/spec/ffi/fixtures/VariadicTest.c:85:17:  [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++, &d, sizeof(d));
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/io_spec.c:144: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[RB_IO_WAIT_READABLE_BUF];
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:59: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 buf[BUFSIZE];
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:114:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char buf[BUFSIZE];
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.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 header[CHUNK_HEADER_LEN];
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:227:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  if ((f = open(filename, O_RDONLY)) < 0) {
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:329:14:  [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).
  exitcode = atoi(buf);
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:363: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 wbuf[BUFSIZE];
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:648:10:  [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).
  port = atoi(nailgun_port);
data/jruby-9.1.17.0/spec/ffi/fixtures/StructTest.c:234: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).
        cp = malloc(strlen(ss.bytes) + 1);
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/class_spec.c:124:72:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
VALUE class_spec_define_attr(VALUE self, VALUE klass, VALUE sym, VALUE read, VALUE write) {
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/exception_spec.c:14: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).
  return rb_exc_new(rb_eException, cstr, strlen(cstr));
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/io_spec.c:151:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if(read(fd, buf, RB_IO_WAIT_READABLE_BUF) != -1) {
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/io_spec.c:160:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if(read(fd, buf, RB_IO_WAIT_READABLE_BUF) != 13) {
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/string_spec.c:79:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  rb_str_buf_cat(str, question_mark, strlen(question_mark));
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/symbol_spec.c:50:28:  [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 rb_str_new(c_str, strlen(c_str));
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/thread_spec.c:34:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    rv = read(rfd, &dummy, 1);
data/jruby-9.1.17.0/spec/ruby/optional/capi/ext/thread_spec.c:70:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read(rfd, &dummy, 1) == -1 && errno == EINTR) {
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:232:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  i = read(f, buf, BUFSIZE);
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:236:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    i = read(f, buf, BUFSIZE);
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:255:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int len = text ? strlen(text) : 0;
data/jruby-9.1.17.0/tool/nailgun/src/c/ng.c:392:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int bytesread = read(STDIN_FILENO, buf, BUFSIZE);

ANALYSIS SUMMARY:

Hits = 33
Lines analyzed = 9141 in approximately 2.63 seconds (3481 lines/second)
Physical Source Lines of Code (SLOC) = 7152
Hits@level = [0]  34 [1]  13 [2]  14 [3]   2 [4]   4 [5]   0
Hits@level+ = [0+]  67 [1+]  33 [2+]  20 [3+]   6 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 9.36801 [1+] 4.61409 [2+] 2.79642 [3+] 0.838926 [4+] 0.559284 [5+]   0
Dot directories skipped = 4 (--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.