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-rnetcdf-2.4-2/src/RNetCDF.h
Examining data/r-cran-rnetcdf-2.4-2/src/udunits.c
Examining data/r-cran-rnetcdf-2.4-2/src/init.c
Examining data/r-cran-rnetcdf-2.4-2/src/type.c
Examining data/r-cran-rnetcdf-2.4-2/src/attribute.c
Examining data/r-cran-rnetcdf-2.4-2/src/convert.c
Examining data/r-cran-rnetcdf-2.4-2/src/dataset.c
Examining data/r-cran-rnetcdf-2.4-2/src/group.c
Examining data/r-cran-rnetcdf-2.4-2/src/common.c
Examining data/r-cran-rnetcdf-2.4-2/src/variable.c
Examining data/r-cran-rnetcdf-2.4-2/src/convert.h
Examining data/r-cran-rnetcdf-2.4-2/src/common.h
Examining data/r-cran-rnetcdf-2.4-2/src/dimension.c

FINAL RESULTS:

data/r-cran-rnetcdf-2.4-2/src/RNetCDF.h:169:39:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
R_nc_par_var (SEXP nc, SEXP var, SEXP access);
data/r-cran-rnetcdf-2.4-2/src/common.c:180: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 (typename, str);
data/r-cran-rnetcdf-2.4-2/src/variable.c:788:39:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
R_nc_par_var (SEXP nc, SEXP var, SEXP access)
data/r-cran-rnetcdf-2.4-2/src/variable.c:804:19:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  if (R_nc_strcmp(access, "NC_COLLECTIVE")) {
data/r-cran-rnetcdf-2.4-2/src/variable.c:806:26:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  } else if (R_nc_strcmp(access, "NC_INDEPENDENT")) {
data/r-cran-rnetcdf-2.4-2/src/attribute.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 attname[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/attribute.c:117: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 attname[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/attribute.c:148:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char attname[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/attribute.c:197: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 attname[NC_MAX_NAME+1], atttype[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/attribute.c:246: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 namefld[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/convert.c:283: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(io->rbuf, io->cbuf, xlength(io->rxp) * sizeof(char));
data/r-cran-rnetcdf-2.4-2/src/convert.c:924: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 (xdim, io->xdim, ndim * sizeof(size_t));
data/r-cran-rnetcdf-2.4-2/src/convert.c:942: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(io->rbuf, io->cbuf, xlength(io->rxp) * sizeof(char));
data/r-cran-rnetcdf-2.4-2/src/convert.c:1020:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(out + ifac*size, memvals + imem*size, size);
data/r-cran-rnetcdf-2.4-2/src/convert.c:1055:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(work+1+ii*2, "%02X", in[ii]);
data/r-cran-rnetcdf-2.4-2/src/convert.c:1142: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 *bufout, namefld[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/convert.c:1212: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 (bufout+ielem*size+offset, buffld+ielem*fldlen, fldlen);
data/r-cran-rnetcdf-2.4-2/src/convert.c:1268: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 namefld[NC_MAX_NAME+1], *buffld, *bufcmp;
data/r-cran-rnetcdf-2.4-2/src/convert.c:1331: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 (buffld+ielem*fldlen, bufcmp+ielem*size+offset, fldlen);
data/r-cran-rnetcdf-2.4-2/src/convert.c:1585: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 (io->xdim, xdim, ndim*sizeof(size_t));
data/r-cran-rnetcdf-2.4-2/src/convert.c:1589: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 (io->xdim, xdim, sizeof(size_t));
data/r-cran-rnetcdf-2.4-2/src/convert.c:1596: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 (io->fill, fill, fillsize);
data/r-cran-rnetcdf-2.4-2/src/convert.c:1601: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 (io->min, min, fillsize);
data/r-cran-rnetcdf-2.4-2/src/convert.c:1606: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 (io->max, max, fillsize);
data/r-cran-rnetcdf-2.4-2/src/convert.c:1871: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 (cv, voidbuf, nr*sizeof (TYPE)); \
data/r-cran-rnetcdf-2.4-2/src/dimension.c:140:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy (INTEGER (result), unlimids, nunlim * sizeof (int));
data/r-cran-rnetcdf-2.4-2/src/dimension.c:157: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 dimname[NC_MAX_NAME + 1];
data/r-cran-rnetcdf-2.4-2/src/group.c:115:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char *name, *fullname, namebuf[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/type.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 typename[NC_MAX_NAME + 1], basename[NC_MAX_NAME + 1];
data/r-cran-rnetcdf-2.4-2/src/type.c:339: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 fieldname[NC_MAX_NAME + 1], subname[NC_MAX_NAME + 1];
data/r-cran-rnetcdf-2.4-2/src/variable.c:595: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 varname[NC_MAX_NAME + 1], vartype[NC_MAX_NAME+1];
data/r-cran-rnetcdf-2.4-2/src/attribute.c:61:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (attname, CHAR (STRING_ELT (att, 0)), NC_MAX_NAME);
data/r-cran-rnetcdf-2.4-2/src/attribute.c:316: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).
    cnt = strlen (R_nc_strarg (data));
data/r-cran-rnetcdf-2.4-2/src/common.c:189:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  typelen = strlen (str);
data/r-cran-rnetcdf-2.4-2/src/convert.c:182:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  size_t ii, strlen, cnt;
data/r-cran-rnetcdf-2.4-2/src/convert.c:200: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).
  carr = R_alloc (cnt*strlen, sizeof (char));
data/r-cran-rnetcdf-2.4-2/src/convert.c:201:51:  [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).
  for (ii=0, thisstr=carr; ii<cnt; ii++, thisstr+=strlen) {
data/r-cran-rnetcdf-2.4-2/src/convert.c:202:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(thisstr, CHAR( STRING_ELT (rstr, ii)), strlen);
data/r-cran-rnetcdf-2.4-2/src/convert.c:202:52:  [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(thisstr, CHAR( STRING_ELT (rstr, ii)), strlen);
data/r-cran-rnetcdf-2.4-2/src/convert.c:326:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    nchar = strlen (cstr[ii]);
data/r-cran-rnetcdf-2.4-2/src/convert.c:814: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).
        len = strlen (CHAR (STRING_ELT (item, 0)));
data/r-cran-rnetcdf-2.4-2/src/dataset.c:178:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strlen (filep) > 0) {
data/r-cran-rnetcdf-2.4-2/src/dataset.c:294:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strlen (filep) > 0) {

ANALYSIS SUMMARY:

Hits = 43
Lines analyzed = 5780 in approximately 0.17 seconds (34913 lines/second)
Physical Source Lines of Code (SLOC) = 3917
Hits@level = [0]   0 [1]  12 [2]  26 [3]   0 [4]   5 [5]   0
Hits@level+ = [0+]  43 [1+]  43 [2+]  31 [3+]   5 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 10.9778 [1+] 10.9778 [2+] 7.91422 [3+] 1.27649 [4+] 1.27649 [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.