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-stringdist-0.9.6.3/src/lv.c Examining data/r-cran-stringdist-0.9.6.3/src/lcs.c Examining data/r-cran-stringdist-0.9.6.3/src/jaro.c Examining data/r-cran-stringdist-0.9.6.3/src/utils.c Examining data/r-cran-stringdist-0.9.6.3/src/stringdist.h Examining data/r-cran-stringdist-0.9.6.3/src/qtree.h Examining data/r-cran-stringdist-0.9.6.3/src/Rstringdist.c Examining data/r-cran-stringdist-0.9.6.3/src/utils.h Examining data/r-cran-stringdist-0.9.6.3/src/utf8ToInt.c Examining data/r-cran-stringdist-0.9.6.3/src/soundex.c Examining data/r-cran-stringdist-0.9.6.3/src/osa.c Examining data/r-cran-stringdist-0.9.6.3/src/R_register_native.c Examining data/r-cran-stringdist-0.9.6.3/src/dictionary.h Examining data/r-cran-stringdist-0.9.6.3/src/stringdist.c Examining data/r-cran-stringdist-0.9.6.3/src/qgram.c Examining data/r-cran-stringdist-0.9.6.3/src/hamming.c Examining data/r-cran-stringdist-0.9.6.3/src/dl.c Examining data/r-cran-stringdist-0.9.6.3/src/dist.h Examining data/r-cran-stringdist-0.9.6.3/inst/include/stringdist_api.h FINAL RESULTS: data/r-cran-stringdist-0.9.6.3/src/qgram.c:239: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(Q->qgram, qgram, sizeof(int) * q); data/r-cran-stringdist-0.9.6.3/src/qgram.c:243:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (node != NULL ) memcpy(node, Q->n, sizeof(double) * nLoc); data/r-cran-stringdist-0.9.6.3/src/qgram.c:252:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (node != NULL ) memcpy(node,Q->n, sizeof(double) * nLoc); data/r-cran-stringdist-0.9.6.3/src/qgram.c:277: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. if (node != NULL) memcpy(node, Q->n, sizeof(double) * nLoc); data/r-cran-stringdist-0.9.6.3/src/qgram.c:517: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(qgrams + q*index[0], Q->qgram, sizeof(int) * q); data/r-cran-stringdist-0.9.6.3/src/qgram.c:518: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(count + nLoc*index[0], Q->n, sizeof(double) * nLoc); data/r-cran-stringdist-0.9.6.3/src/soundex.c:240: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 sndx[5]; data/r-cran-stringdist-0.9.6.3/src/stringdist.c:47: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->weight, va_arg(args, double *), 4*sizeof(double)); data/r-cran-stringdist-0.9.6.3/src/stringdist.c:52: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->weight, va_arg(args, double *), 3*sizeof(double)); data/r-cran-stringdist-0.9.6.3/src/stringdist.c:58: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->weight, va_arg(args, double *), 4*sizeof(double)); data/r-cran-stringdist-0.9.6.3/src/stringdist.c:85: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->weight, va_arg(args, double *), 3*sizeof(double)); data/r-cran-stringdist-0.9.6.3/src/utf8ToInt.c:163: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(c , INTEGER(VECTOR_ELT(x,i)), (*len) * sizeof(int)); data/r-cran-stringdist-0.9.6.3/src/utf8ToInt.c:237: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(d, INTEGER(VECTOR_ELT(str,i)), (*t)*sizeof(int) ); data/r-cran-stringdist-0.9.6.3/src/qgram.c:284:50: [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). static qtree *push_string(unsigned int *str, int strlen, unsigned int q, qtree *Q, int iLoc, int nLoc){ ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 3015 in approximately 0.10 seconds (29753 lines/second) Physical Source Lines of Code (SLOC) = 1721 Hits@level = [0] 0 [1] 1 [2] 13 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 14 [1+] 14 [2+] 13 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 8.13481 [1+] 8.13481 [2+] 7.55375 [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.