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-textshaping-0.2.1/src/face_feature.h Examining data/r-cran-textshaping-0.2.1/src/hb_shaper.cpp Examining data/r-cran-textshaping-0.2.1/src/hb_shaper.h Examining data/r-cran-textshaping-0.2.1/src/init.cpp Examining data/r-cran-textshaping-0.2.1/src/cache_lru.h Examining data/r-cran-textshaping-0.2.1/src/utils.h Examining data/r-cran-textshaping-0.2.1/src/string_bidi.h Examining data/r-cran-textshaping-0.2.1/src/string_shape.cpp Examining data/r-cran-textshaping-0.2.1/src/string_shape.h Examining data/r-cran-textshaping-0.2.1/src/string_bidi.cpp Examining data/r-cran-textshaping-0.2.1/src/face_feature.cpp Examining data/r-cran-textshaping-0.2.1/src/string_metrics.cpp Examining data/r-cran-textshaping-0.2.1/src/string_metrics.h Examining data/r-cran-textshaping-0.2.1/src/cpp11.cpp Examining data/r-cran-textshaping-0.2.1/inst/include/textshaping.h FINAL RESULTS: data/r-cran-textshaping-0.2.1/src/face_feature.cpp:28: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 tag_temp[5]; data/r-cran-textshaping-0.2.1/src/utils.h:49: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. static const char trailingBytesForUTF8[256] = { data/r-cran-textshaping-0.2.1/src/utils.h:15:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, e.what(), ERROR_SIZE - 1); \ data/r-cran-textshaping-0.2.1/src/utils.h:18:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buf, "C++ error (unknown cause)", ERROR_SIZE - 1); \ data/r-cran-textshaping-0.2.1/src/utils.h:176:19: [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). int n_bytes = strlen(string) + 1; ANALYSIS SUMMARY: Hits = 5 Lines analyzed = 1707 in approximately 0.05 seconds (31415 lines/second) Physical Source Lines of Code (SLOC) = 1410 Hits@level = [0] 0 [1] 3 [2] 2 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 5 [1+] 5 [2+] 2 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 3.5461 [1+] 3.5461 [2+] 1.41844 [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.