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/tegrarcm-1.8/src/aes-cmac.cpp Examining data/tegrarcm-1.8/src/aes-cmac.h Examining data/tegrarcm-1.8/src/debug.c Examining data/tegrarcm-1.8/src/debug.h Examining data/tegrarcm-1.8/src/main.c Examining data/tegrarcm-1.8/src/miniloader/tegra114-miniloader.h Examining data/tegrarcm-1.8/src/miniloader/tegra124-miniloader.h Examining data/tegrarcm-1.8/src/miniloader/tegra20-miniloader.h Examining data/tegrarcm-1.8/src/miniloader/tegra30-miniloader.h Examining data/tegrarcm-1.8/src/nv3p.c Examining data/tegrarcm-1.8/src/nv3p.h Examining data/tegrarcm-1.8/src/nv3p_status.h Examining data/tegrarcm-1.8/src/rcm.c Examining data/tegrarcm-1.8/src/rcm.h Examining data/tegrarcm-1.8/src/rsa-pss.cpp Examining data/tegrarcm-1.8/src/rsa-pss.h Examining data/tegrarcm-1.8/src/usb.c Examining data/tegrarcm-1.8/src/usb.h FINAL RESULTS: data/tegrarcm-1.8/src/debug.h:39:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...); data/tegrarcm-1.8/src/debug.h:40:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...) data/tegrarcm-1.8/src/debug.h:44:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, args); data/tegrarcm-1.8/src/debug.h:49:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...); data/tegrarcm-1.8/src/debug.h:50:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...) { } data/tegrarcm-1.8/src/main.c:271:7: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long(argc, argv, "h0", data/tegrarcm-1.8/src/aes-cmac.cpp:92:2: [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(cmac_buf, mac.data(), mac.length()); data/tegrarcm-1.8/src/main.c:581:7: [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). fp = fopen(filename, "wb"); data/tegrarcm-1.8/src/main.c:602: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 query_version_rcm_filename[PATH_MAX]; data/tegrarcm-1.8/src/main.c:651:8: [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). fd = open(query_version_rcm_filename, O_RDONLY, 0); data/tegrarcm-1.8/src/main.c:721: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 ml_rcm_filename[PATH_MAX]; data/tegrarcm-1.8/src/main.c:765:8: [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). fd = open(filename, O_RDONLY, 0); data/tegrarcm-1.8/src/main.c:871:7: [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). fd = open(filename, O_RDONLY, 0); data/tegrarcm-1.8/src/main.c:931: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 ml_rcm_filename[PATH_MAX]; data/tegrarcm-1.8/src/main.c:1125:7: [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). fd = open(filename, O_WRONLY | O_CREAT, 0644); data/tegrarcm-1.8/src/main.c:1164:7: [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). fd = open(filename, O_RDONLY, 0); data/tegrarcm-1.8/src/main.c:1210:4: [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 signature_filename[PATH_MAX]; data/tegrarcm-1.8/src/main.c:1250: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 signature_filename[PATH_MAX]; data/tegrarcm-1.8/src/nv3p.c:133:10: [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. unsigned char s_buffer[NV3P_MAX_COMMAND_SIZE]; data/tegrarcm-1.8/src/nv3p.c:134:10: [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. unsigned char s_args[NV3P_MAX_COMMAND_SIZE]; // handed out to clients data/tegrarcm-1.8/src/nv3p.c:641: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(a->msg, tmp, NV3P_STRING_MAX); data/tegrarcm-1.8/src/nv3p.c:822:2: [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(buf, packet + offset, len); data/tegrarcm-1.8/src/nv3p.h:134: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 msg[NV3P_STRING_MAX]; data/tegrarcm-1.8/src/rcm.c:142: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(msg_payload, payload, payload_len); data/tegrarcm-1.8/src/rcm.c:304: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(msg->args, args, args_len); data/tegrarcm-1.8/src/rcm.c:338: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(msg->args, args, args_len); data/tegrarcm-1.8/src/rcm.c:372: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(msg->args, args, args_len); data/tegrarcm-1.8/src/usb.c:61: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 portstr[(PORT_MATCH_MAX_PORTS * 4)]; data/tegrarcm-1.8/src/usb.c:110: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(match_ports, dev_ports, dev_ports_len); data/tegrarcm-1.8/src/main.c:564:7: [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). if ((strlen(in) + strlen(ext) + 1) > PATH_MAX) { data/tegrarcm-1.8/src/main.c:564:20: [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). if ((strlen(in) + strlen(ext) + 1) > PATH_MAX) { data/tegrarcm-1.8/src/main.c:567:4: [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). strlen(in) + strlen(ext) + 1 - PATH_MAX, in); data/tegrarcm-1.8/src/main.c:567:17: [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). strlen(in) + strlen(ext) + 1 - PATH_MAX, in); data/tegrarcm-1.8/src/main.c:670:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, msg_buff, sb.st_size) != sb.st_size) { data/tegrarcm-1.8/src/main.c:782:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, miniloader, miniloader_size) != miniloader_size) { data/tegrarcm-1.8/src/main.c:894:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read(fd, buf, size); ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 37582 in approximately 4.18 seconds (8996 lines/second) Physical Source Lines of Code (SLOC) = 36380 Hits@level = [0] 110 [1] 7 [2] 23 [3] 1 [4] 5 [5] 0 Hits@level+ = [0+] 146 [1+] 36 [2+] 29 [3+] 6 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 4.01319 [1+] 0.989555 [2+] 0.797141 [3+] 0.164926 [4+] 0.137438 [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.