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-lbfgsb3c-2020-3.2/src/init.c Examining data/r-cran-lbfgsb3c-2020-3.2/src/RcppExports.cpp Examining data/r-cran-lbfgsb3c-2020-3.2/src/lbfgsb3x.cpp Examining data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3c.h Examining data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3x.h FINAL RESULTS: data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3c.h:15:60: [2] (integer) atol: 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 maxit, char *msg, int trace, int nREPORT, double atol, double rtol, data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3c.h:22:61: [2] (integer) atol: 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 maxit, char *msg, int trace, int nREPORT, double atol, double rtol, data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3c.h:27:44: [2] (integer) atol: 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). grcount, maxit, msg, trace, nREPORT, atol, rtol, g); data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3x.h:15:60: [2] (integer) atol: 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 maxit, char *msg, int trace, int nREPORT, double atol, double rtol, data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3x.h:22:61: [2] (integer) atol: 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 maxit, char *msg, int trace, int nREPORT, double atol, double rtol, data/r-cran-lbfgsb3c-2020-3.2/inst/include/lbfgsb3x.h:27:44: [2] (integer) atol: 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). grcount, maxit, msg, trace, nREPORT, atol, rtol, g); data/r-cran-lbfgsb3c-2020-3.2/src/init.c:12:16: [2] (integer) atol: 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). double atol, double rtol, double *g); data/r-cran-lbfgsb3c-2020-3.2/src/lbfgsb3x.cpp:27:13: [2] (integer) atol: 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). double atol, double rtol, double *g){ data/r-cran-lbfgsb3c-2020-3.2/src/lbfgsb3x.cpp:126:66: [2] (integer) atol: 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). bool converge=fabs(lastx[n-1]-x[n-1]) < fabs(x[n-1])*rtol+atol; data/r-cran-lbfgsb3c-2020-3.2/src/lbfgsb3x.cpp:129:59: [2] (integer) atol: 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). converge=fabs(lastx[i]-x[i]) < fabs(x[i])*rtol+atol; data/r-cran-lbfgsb3c-2020-3.2/src/lbfgsb3x.cpp:276: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 msg[120]; data/r-cran-lbfgsb3c-2020-3.2/src/lbfgsb3x.cpp:279:44: [2] (integer) atol: 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). &grcount, maxit, msg, trace, iprint , atol, rtol, &g[0]); ANALYSIS SUMMARY: Hits = 12 Lines analyzed = 466 in approximately 0.04 seconds (11623 lines/second) Physical Source Lines of Code (SLOC) = 418 Hits@level = [0] 0 [1] 0 [2] 12 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 12 [1+] 12 [2+] 12 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 28.7081 [1+] 28.7081 [2+] 28.7081 [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.