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-randomfieldsutils-0.5.3/inst/include/zzz_RandomFieldsUtils.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/AutoRandomFieldsUtils.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/Utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/intrinsics.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/Solve.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/scalar.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/zzz_calls.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/local3.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/kleinkram.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/win_linux_aux.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/linear.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/General_utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/local2.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/local1.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/AutoRandomFieldsUtilsLocal.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/Options_utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/inst/include/Basic_utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/zzz_RandomFieldsUtils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/AutoRandomFieldsUtils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/own.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/Utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/intrinsics.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/win_linux_aux.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/linear.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/Solve.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/scalar.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/RFoptions.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/zzz_calls.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/kleinkram.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/kleinkram.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/brdomain.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/zzz.c
Examining data/r-cran-randomfieldsutils-0.5.3/src/sort.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/RandomFieldsUtils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/win_linux_aux.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/linear.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/General_utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/options.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/own.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/AutoRandomFieldsUtilsLocal.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/Options_utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/Basic_utils.h
Examining data/r-cran-randomfieldsutils-0.5.3/src/utils.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/scalar.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/solve.cc
Examining data/r-cran-randomfieldsutils-0.5.3/src/maths.cc

FINAL RESULTS:

data/r-cran-randomfieldsutils-0.5.3/inst/include/Basic_utils.h:167:27:  [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).
#define STRCPY(A, B) std::strcpy(A, B)
data/r-cran-randomfieldsutils-0.5.3/inst/include/Basic_utils.h:178:22:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
#define SPRINTF std::sprintf //
data/r-cran-randomfieldsutils-0.5.3/src/Basic_utils.h:167:27:  [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).
#define STRCPY(A, B) std::strcpy(A, B)
data/r-cran-randomfieldsutils-0.5.3/src/Basic_utils.h:178:22:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
#define SPRINTF std::sprintf //
data/r-cran-randomfieldsutils-0.5.3/inst/include/Basic_utils.h:172:23:  [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 MEMCOPYX std::memcpy
data/r-cran-randomfieldsutils-0.5.3/inst/include/Options_utils.h:51: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.
extern const char *basic[basicN];
data/r-cran-randomfieldsutils-0.5.3/inst/include/Options_utils.h:65: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.
extern const char * InversionNames[nr_InversionMethods];
data/r-cran-randomfieldsutils-0.5.3/inst/include/Options_utils.h:94: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.
extern const char * solve[solveN];
data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h:45: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 errorstring_type[MAXERRORSTRING];
data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h:46: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 errorloc_type[nErrorLoc];
data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h:50:23:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
#define LOCAL_ERRMSG2 char MSG2[LENERRMSG]
data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h:52:54:  [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.
#define LOCAL_ERRLOC_MSG errorloc_type ERROR_LOC=""; char ERRMSG[LENERRMSG];
data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h:67:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char ERRMSG[LENERRMSG], // used by Error_utils.h. Never use elsewhere
data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h:101:20:  [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.
#define W_ERRLINE0 char W_ERRMSG[LENERRMSG]
data/r-cran-randomfieldsutils-0.5.3/inst/include/errors_messages.h:102:20:  [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.
#define W_ERRLINE  char W_MSG2[LENERRMSG]
data/r-cran-randomfieldsutils-0.5.3/src/Basic_utils.h:172:23:  [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 MEMCOPYX std::memcpy
data/r-cran-randomfieldsutils-0.5.3/src/Options_utils.h:51: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.
extern const char *basic[basicN];
data/r-cran-randomfieldsutils-0.5.3/src/Options_utils.h:65: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.
extern const char * InversionNames[nr_InversionMethods];
data/r-cran-randomfieldsutils-0.5.3/src/Options_utils.h:94: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.
extern const char * solve[solveN];
data/r-cran-randomfieldsutils-0.5.3/src/RFoptions.cc:38: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 VARIABLE_IS_NOT_USED  name[LEN_OPTIONNAME], 
data/r-cran-randomfieldsutils-0.5.3/src/RFoptions.cc:61: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.
const char  *basic_options[MAXNLIST] = {ownprefixlist[1], NULL, NULL, NULL},
data/r-cran-randomfieldsutils-0.5.3/src/RFoptions.cc: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 name[LEN_OPTIONNAME];
data/r-cran-randomfieldsutils-0.5.3/src/RFoptions.cc:271: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 prefix[LEN_OPTIONNAME / 2], mainname[LEN_OPTIONNAME / 2];   
data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h:45: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 errorstring_type[MAXERRORSTRING];
data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h:46: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 errorloc_type[nErrorLoc];
data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h:50:23:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
#define LOCAL_ERRMSG2 char MSG2[LENERRMSG]
data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h:52:54:  [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.
#define LOCAL_ERRLOC_MSG errorloc_type ERROR_LOC=""; char ERRMSG[LENERRMSG];
data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h:67:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char ERRMSG[LENERRMSG], // used by Error_utils.h. Never use elsewhere
data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h:101:20:  [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.
#define W_ERRLINE0 char W_ERRMSG[LENERRMSG]
data/r-cran-randomfieldsutils-0.5.3/src/errors_messages.h:102:20:  [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.
#define W_ERRLINE  char W_MSG2[LENERRMSG]
data/r-cran-randomfieldsutils-0.5.3/src/kleinkram.cc:409: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 *tooLarge[nTooLarge] = {"size", "msg"};
data/r-cran-randomfieldsutils-0.5.3/src/kleinkram.cc:1007: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 dummy[1000];
data/r-cran-randomfieldsutils-0.5.3/src/kleinkram.cc:1036: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 info[1000];
data/r-cran-randomfieldsutils-0.5.3/src/options.cc:36: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.
const char *basic[basicN] =
data/r-cran-randomfieldsutils-0.5.3/src/options.cc:40: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.
const char * solve[solveN] = 
data/r-cran-randomfieldsutils-0.5.3/src/options.cc:52: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.
const char * ownprefixlist[ownprefixN] = {"basic", "solve"};
data/r-cran-randomfieldsutils-0.5.3/src/options.cc:53: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.
const char **ownall[ownprefixN] = {basic, solve};
data/r-cran-randomfieldsutils-0.5.3/src/options.cc:76:47:  [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.
void setparameterUtils(int i, int j, SEXP el, char name[LEN_OPTIONNAME], 
data/r-cran-randomfieldsutils-0.5.3/src/own.cc:39: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 ERRMSG[LENERRMSG], MSG[LENERRMSG], MSG2[LENERRMSG];
data/r-cran-randomfieldsutils-0.5.3/src/own.h:31:47:  [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.
void setparameterUtils(int i, int j, SEXP el, char name[200], bool isList, int local);
data/r-cran-randomfieldsutils-0.5.3/src/own.h:39: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.
extern const char * ownprefixlist[ownprefixN],
data/r-cran-randomfieldsutils-0.5.3/src/solve.cc:72: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.
const char * InversionNames[nr_InversionMethods] = {
data/r-cran-randomfieldsutils-0.5.3/src/solve.cc:887: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 msg[500];
data/r-cran-randomfieldsutils-0.5.3/src/solve.cc:1163:10:  [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 *advice[2]={"",
data/r-cran-randomfieldsutils-0.5.3/inst/include/Basic_utils.h:168: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).
#define STRLEN std::strlen
data/r-cran-randomfieldsutils-0.5.3/src/Basic_utils.h:168: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).
#define STRLEN std::strlen
data/r-cran-randomfieldsutils-0.5.3/src/kleinkram.cc:35:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(dest, src, n);
data/r-cran-randomfieldsutils-0.5.3/src/solve.cc:347:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      *p_read = RESULT + read;
data/r-cran-randomfieldsutils-0.5.3/src/solve.cc:350:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int write = read;
data/r-cran-randomfieldsutils-0.5.3/src/solve.cc:358:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      p_read = RESULT + read;
data/r-cran-randomfieldsutils-0.5.3/src/win_linux_aux.cc:54:3:  [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((useconds_t) (1000 * (unsigned long) *milli));
data/r-cran-randomfieldsutils-0.5.3/src/win_linux_aux.cc:62:3:  [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((useconds_t) *micro);

ANALYSIS SUMMARY:

Hits = 52
Lines analyzed = 9901 in approximately 0.31 seconds (31849 lines/second)
Physical Source Lines of Code (SLOC) = 6828
Hits@level = [0]   0 [1]   8 [2]  40 [3]   0 [4]   4 [5]   0
Hits@level+ = [0+]  52 [1+]  52 [2+]  44 [3+]   4 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 7.6157 [1+] 7.6157 [2+] 6.44405 [3+] 0.585823 [4+] 0.585823 [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.