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/devio-1.2/src/devio.c FINAL RESULTS: data/devio-1.2/src/devio.c:1516:6: [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. printf(buffer, stack[0], stack[-1], stack[-2], stack[-3], data/devio-1.2/src/devio.c:130: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(to, from, cb); data/devio-1.2/src/devio.c:250:11: [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). int fd = open(pname, (fwrite && !fverify) ? O_RDWR : O_RDONLY); data/devio-1.2/src/devio.c:341:4: [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(pfile->pbuf, pfile->pwritebuf, pfile->deviceoffset-pfile->bufferoffset); data/devio-1.2/src/devio.c:513: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(pfile->pwritebuf+ioffset, pfile->pbuf+ioffset, cb); data/devio-1.2/src/devio.c:576: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(pbuf, (pfile->fwrite ? pfile->pwritebuf : pfile->pbuf) + data/devio-1.2/src/devio.c:604: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(pfile->pwritebuf + (pfile->useroffset-pfile->bufferoffset), pbuf, cbavail); data/devio-1.2/src/devio.c:650: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(pto->pwritebuf + (pto->useroffset-pto->bufferoffset), data/devio-1.2/src/devio.c:776:12: [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 buf[1024]; data/devio-1.2/src/devio.c:797:11: [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 buf[1024]; data/devio-1.2/src/devio.c:1184: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(buffer, line+start, end); data/devio-1.2/src/devio.c:1287: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. unsigned char buffer[STR_MAX]; data/devio-1.2/src/devio.c:126:14: [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). size_t cb = strlen(from)+1; data/devio-1.2/src/devio.c:493:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t cb = read(pfile->fd, pfile->pbuf+ioffset, cbread); data/devio-1.2/src/devio.c:726:7: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). b = getchar(); data/devio-1.2/src/devio.c:1268:21: [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). const int AcEnd = strlen(line); data/devio-1.2/src/devio.c:1467:29: [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). outputbytes(pp, buffer, strlen(buffer)); ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 1846 in approximately 0.17 seconds (10833 lines/second) Physical Source Lines of Code (SLOC) = 1300 Hits@level = [0] 13 [1] 5 [2] 11 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 30 [1+] 17 [2+] 12 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 23.0769 [1+] 13.0769 [2+] 9.23077 [3+] 0.769231 [4+] 0.769231 [5+] 0 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.