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/r-cran-brio-1.1.0/src/brio.h
Examining data/r-cran-brio-1.1.0/src/file_line_endings.c
Examining data/r-cran-brio-1.1.0/src/init.c
Examining data/r-cran-brio-1.1.0/src/read_file.c
Examining data/r-cran-brio-1.1.0/src/read_file_raw.c
Examining data/r-cran-brio-1.1.0/src/read_lines.c
Examining data/r-cran-brio-1.1.0/src/write_file.c
Examining data/r-cran-brio-1.1.0/src/brio.c
Examining data/r-cran-brio-1.1.0/src/write_lines.c

FINAL RESULTS:

data/r-cran-brio-1.1.0/src/brio.c:14:3:  [2] (buffer) wchar_t:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  wchar_t mode_w[10];
data/r-cran-brio-1.1.0/src/brio.c:15:3:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  MultiByteToWideChar(CP_UTF8, 0, mode, -1, mode_w, 9);
data/r-cran-brio-1.1.0/src/brio.c:19:16:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  size_t len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
data/r-cran-brio-1.1.0/src/brio.c:28:3:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  MultiByteToWideChar(CP_UTF8, 0, path, -1, buf, len);
data/r-cran-brio-1.1.0/src/brio.c:31:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  out = fopen(path, mode);
data/r-cran-brio-1.1.0/src/read_file_raw.c:36: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(RAW(ans), read_buf, file_size);
data/r-cran-brio-1.1.0/src/read_lines.c:33: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->data + buf->size, in, in_size);
data/r-cran-brio-1.1.0/src/read_lines.c:59: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 read_buf[READ_BUF_SIZE];
data/r-cran-brio-1.1.0/src/file_line_endings.c:19:15:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while ((c = fgetc(fp)) != EOF) {

ANALYSIS SUMMARY:

Hits = 9
Lines analyzed = 386 in approximately 0.02 seconds (20122 lines/second)
Physical Source Lines of Code (SLOC) = 296
Hits@level = [0]   3 [1]   1 [2]   8 [3]   0 [4]   0 [5]   0
Hits@level+ = [0+]  12 [1+]   9 [2+]   8 [3+]   0 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 40.5405 [1+] 30.4054 [2+] 27.027 [3+]   0 [4+]   0 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.