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/usbauth-1.0.2/src/usbauth.h Examining data/usbauth-1.0.2/src/usbauth.c FINAL RESULTS: data/usbauth-1.0.2/src/usbauth.c:339:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(valueStr, 16, "%" SCNu8, authorize); data/usbauth-1.0.2/src/usbauth.c:120:2: [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 cntStr[16]; data/usbauth-1.0.2/src/usbauth.c:273:17: [2] (misc) fopen: 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). FILE *probe = fopen("/sys/bus/usb/drivers_probe", "w"); data/usbauth-1.0.2/src/usbauth.c:333:2: [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 valueStr[16]; data/usbauth-1.0.2/src/usbauth.c:121:2: [1] (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 character. strcpy(cntStr, ""); data/usbauth-1.0.2/src/usbauth.c:126:12: [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). rvalLen = strlen(rvalStr); data/usbauth-1.0.2/src/usbauth.c:131:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmpStr, rvalStr + 1, rvalLen); data/usbauth-1.0.2/src/usbauth.c:338:2: [1] (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 character. strcpy(valueStr, ""); ANALYSIS SUMMARY: Hits = 8 Lines analyzed = 973 in approximately 0.03 seconds (29417 lines/second) Physical Source Lines of Code (SLOC) = 541 Hits@level = [0] 18 [1] 4 [2] 3 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 26 [1+] 8 [2+] 4 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 48.0591 [1+] 14.7874 [2+] 7.39372 [3+] 1.84843 [4+] 1.84843 [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.