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/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp Examining data/jssc-2.8.0/src/cpp/windows/jssc.c++ Examining data/jssc-2.8.0/src/cpp/jssc_SerialNativeInterface.h FINAL RESULTS: data/jssc-2.8.0/src/cpp/windows/jssc.c++:50: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(portFullName, prefix); data/jssc-2.8.0/src/cpp/windows/jssc.c++:51:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(portFullName, port); data/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp:71:19: [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). jlong hComm = open(port, O_RDWR | O_NOCTTY | O_NDELAY); data/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp:907:13: [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 buffer[MAXPATHLEN]; data/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp:920:13: [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 buffer[MAXPATHLEN]; data/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp:941:13: [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 buffer[255]; data/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp:947: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. sprintf(buffer, "%04x", val); data/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp:958: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. sprintf(buffer, "%04x", val); data/jssc-2.8.0/src/cpp/windows/jssc.c++:49: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 portFullName[strlen(prefix) + strlen(port) + 1]; data/jssc-2.8.0/src/cpp/windows/jssc.c++:621: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 valueName[256]; data/jssc-2.8.0/src/cpp/windows/jssc.c++:640:13: [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 lpValueName[256]; data/jssc-2.8.0/src/cpp/_nix_based/jssc.cpp:545:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int result = read(portHandle, lpBuffer + (byteCount - byteRemains), byteRemains); data/jssc-2.8.0/src/cpp/windows/jssc.c++:49:23: [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). char portFullName[strlen(prefix) + strlen(port) + 1]; data/jssc-2.8.0/src/cpp/windows/jssc.c++:49:40: [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). char portFullName[strlen(prefix) + strlen(port) + 1]; ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 1911 in approximately 0.10 seconds (19920 lines/second) Physical Source Lines of Code (SLOC) = 1354 Hits@level = [0] 0 [1] 3 [2] 9 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 14 [1+] 14 [2+] 11 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 10.3397 [1+] 10.3397 [2+] 8.12408 [3+] 1.4771 [4+] 1.4771 [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.