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-cubature-2.0.4.1/src/cubature-1.0.3/pcubature.c Examining data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/converged.h Examining data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/clencurt.h Examining data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/cubature.h Examining data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c Examining data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/vwrapper.h Examining data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/clencurt_gen.c Examining data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/test.c Examining data/r-cran-cubature-2.0.4.1/src/cubature_init.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/config.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/cuba.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/Global.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/Fork.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/CSample.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/sock.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/Random.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/cuhre/common.c Examining data/r-cran-cubature-2.0.4.1/src/Rcpp-cubature.cpp Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/demo/demo-c.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/cuba.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/partview.cpp Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/common/ChiSquare.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/common/Data.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/common/Parallel.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/common/MSample.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/common/Erf.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Rule.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Integrate.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/decl.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Cuhre.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/Vegas.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/Integrate.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/decl.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/common.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/Grid.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Explore.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Rule.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Sample.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Split.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Iterate.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/decl.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/KorobovCoeff.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Divonne.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/common.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/FindMinimum.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Suave.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Fluct.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Sample.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Integrate.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/decl.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/common.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Grid.c Examining data/r-cran-cubature-2.0.4.1/src/Rcpp-Cuba.cpp Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/cuba.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/Global.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/Fork.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/CSample.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/sock.h Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/Random.c Examining data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/cuhre/common.c Examining data/r-cran-cubature-2.0.4.1/src/RcppExports.cpp Examining data/r-cran-cubature-2.0.4.1/inst/include/rcubature.h Examining data/r-cran-cubature-2.0.4.1/inst/include/cuba.h Examining data/r-cran-cubature-2.0.4.1/inst/include/exp_cubature.h Examining data/r-cran-cubature-2.0.4.1/inst/include/exp_cubature_typedefs.h Examining data/r-cran-cubature-2.0.4.1/inst/include/cubature.h FINAL RESULTS: data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:115:17: [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. ssize_t n = readlink(file, lnrel, PATH_MAX); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/sock.h:15:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_RED ROUTINE " master %d(%d): " s TERM_RESET, core, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/sock.h:17:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_BLUE ROUTINE " worker %d(%d): " s TERM_RESET, core, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/sock.h:29:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_GREEN ROUTINE " pid %d: read " s TERM_RESET, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/sock.h:31:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_MAGENTA ROUTINE " pid %d: write " s TERM_RESET, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:264: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(statefile_tmp, (t)->statefile); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:295:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(s, ini ? \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:322:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(s, fail ? \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/sock.h:15:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_RED ROUTINE " master %d(%d): " s TERM_RESET, core, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/sock.h:17:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_BLUE ROUTINE " worker %d(%d): " s TERM_RESET, core, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/sock.h:29:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_GREEN ROUTINE " pid %d: read " s TERM_RESET, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/sock.h:31:1: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, TERM_MAGENTA ROUTINE " pid %d: write " s TERM_RESET, getpid(), ##__VA_ARGS__) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:255: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(statefile_tmp, (t)->statefile); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:286:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(s, ini ? \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:315:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(s, fail ? \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Rule.c:746:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. oe += sprintf(oe, msg, b->lower, b->upper); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Rule.c:751:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. oe += sprintf(oe, "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:198:17: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. oe += sprintf(oe, "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:370:17: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. oe += sprintf(oe, msg, b->lower, b->upper); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:414:17: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. oe += sprintf(oe, " \tchisq " REAL, SHOW(chisq)); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Sample.c:149:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. p += sprintf(p, msg, b->lower, b->upper); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Sample.c:155:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. p += sprintf(p, "%s \tchisq " REAL " (" COUNT " df)", data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:80: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(path_end, file); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:98: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(sub, file); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:104: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(sub_end, entry->d_name); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:164: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(path, argv[3]); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:168:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "rm -fr %s %s", path, argv[2]); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:169:3: [4] (shell) system: 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. system(cmd); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:174:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "tar %s %s --owner=root --group=root %s", data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:176:3: [4] (shell) system: 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. system(cmd); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:178:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "rm -fr %s", argv[3]); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:179:3: [4] (shell) system: 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. system(cmd); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:94: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. cchar *env = getenv(name); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:94: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. cchar *env = getenv(name); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:132:9: [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(lnabs, tmp) == NULL || data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/Fork.c:51: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 out[128]; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/Fork.c:88: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(out, "using %d cores %d accelerators via " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/Random.c:105: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(pv, pini, inibits*sizeof *pini); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:97:13: [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). var = atoi(env); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:99: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 out[64]; \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:100:9: [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(out, "env " name " = %d", (int)var); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:131: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 Copy(d, s, n) memcpy(d, s, (n)*sizeof(*(d))) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:283:13: [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( (fd = open((t)->statefile, O_RDONLY)) != -1 ) { \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:294: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 s[512]; \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:308:3: [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(statefile_XXXXXX, "-XXXXXX"); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:309:13: [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). if( (fd = mkstemp(statefile_tmp)) != -1 ) { \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:321: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 s[512]; \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:506: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, fs, _l); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/config.h:135:9: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. #define vfork fork data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/Fork.c:47: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 out[128]; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/Fork.c:84: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(out, "using %d cores %d accelerators via " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/Random.c:105: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(pv, pini, inibits*sizeof *pini); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:97:13: [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). var = atoi(env); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:99: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 out[64]; \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:100:9: [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(out, "env " name " = %d", (int)var); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:131: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 Copy(d, s, n) memcpy(d, s, (n)*sizeof(*(d))) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:274:13: [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( (fd = open((t)->statefile, O_RDONLY)) != -1 ) { \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:285: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 s[512]; \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:296: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). #define mkstemp(x) 0 data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:301:3: [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(statefile_XXXXXX, "-XXXXXX"); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:302:13: [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). if( (fd = mkstemp(statefile_tmp)) != -1 ) { \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:314: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 s[512]; \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:500: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, fs, _l); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/common/Parallel.c:33: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 out[128]; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/common/Parallel.c:50: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(out, "sampling " NUMBER " points each on %d cores", data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Integrate.c:46: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(out, "Cuhre input parameters:\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Integrate.c:125:24: [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. char *oe = out + sprintf(out, "\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Integrate.c:129:15: [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. oe += sprintf(oe, "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:39: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(out, "Divonne input parameters:\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:190:26: [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. char *oe = out + sprintf(out, "\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:256:7: [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(out, "\nMain integration on " COUNT data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:326:23: [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(out, "Sampling remaining " COUNT data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:409:17: [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. oe += sprintf(oe, "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:412:33: [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. if( todo == 3 ) oe += sprintf(oe, "\n " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:441:24: [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. char *oe = out + sprintf(out, "\nTotals:"); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:443:15: [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. oe += sprintf(oe, "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Integrate.c:34: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(out, "Suave input parameters:\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Integrate.c:132:24: [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. char *oe = out + sprintf(out, "\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Integrate.c:136:15: [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. oe += sprintf(oe, "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Sample.c:91:15: [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(ss[comp], "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Sample.c:94:15: [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(ss[comp], "\n " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/Integrate.c:32: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(out, "Vegas input parameters:\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/Integrate.c:161:24: [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. char *oe = out + sprintf(out, "\n" data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/Integrate.c:165:15: [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. oe += sprintf(oe, "\n[" COUNT "] " data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:27: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 path[PATH_MAX], *path_end; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:33:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return memcpy(d, s, n) + n; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:89: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 sub[PATH_MAX], *sub_end; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:113: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 src[PATH_MAX], tmp[PATH_MAX]; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:125: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(copydir(tmp, path), lnrel, n); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:141: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 cmd[PATH_MAX]; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/partview.cpp:230:22: [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). const int dimx = atoi(argv[++arg]); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/partview.cpp:231:22: [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). const int dimy = atoi(argv[++arg]); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/partview.cpp:247: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 line[128]; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/clencurt_gen.c:125:25: [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). int M = argc > 1 ? atoi(argv[1]) : 11; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:357:4: [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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:378: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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:380: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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:382: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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:384: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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:397:6: [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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:401:4: [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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:404:4: [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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:407:4: [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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/hcubature.c:410:4: [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(pts, p, sizeof(double) * dim); pts += dim; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/pcubature.c:94:4: [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 + (*ibuf)++ * dim, p, sizeof(double) * dim); data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/pcubature.c:159:6: [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(vc->c[ic].m, m, sizeof(unsigned) * dim); data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/test.c:258:23: [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). dim = argc > 1 ? atoi(argv[1]) : 2; data/r-cran-cubature-2.0.4.1/src/cubature-1.0.3/test.c:260:27: [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). maxEval = argc > 4 ? atoi(argv[4]) : 0; data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:262: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). ccount len = strlen((t)->statefile); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-nonwin/src/common/stddecl.h:287:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ini += size - read(fd, buf, size) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:253: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). ccount len = strlen((t)->statefile); \ data/r-cran-cubature-2.0.4.1/src/Cuba-4.2-win/src/common/stddecl.h:278:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ini += size - read(fd, buf, size) data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Integrate.c:78:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( read(fd, state, statesize) != statesize || data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/cuhre/Integrate.c:86:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size = read(fd, cur, poolsize); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/divonne/Integrate.c:88:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( read(fd, state, statesize) != statesize || data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/suave/Integrate.c:71:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( read(fd, state, statesize) != statesize || data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/src/vegas/Integrate.c:65:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( read(fd, state, statesize) != statesize || data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:99: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). sub_end = sub + strlen(sub); data/r-cran-cubature-2.0.4.1/src/Cuba-4.2/tools/mkdist.c:165: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). path_end = path + strlen(path); ANALYSIS SUMMARY: Hits = 119 Lines analyzed = 210855 in approximately 6.05 seconds (34849 lines/second) Physical Source Lines of Code (SLOC) = 207258 Hits@level = [0] 49 [1] 11 [2] 73 [3] 3 [4] 31 [5] 1 Hits@level+ = [0+] 168 [1+] 119 [2+] 108 [3+] 35 [4+] 32 [5+] 1 Hits/KSLOC@level+ = [0+] 0.810584 [1+] 0.574164 [2+] 0.52109 [3+] 0.168872 [4+] 0.154397 [5+] 0.0048249 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.