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/pconsole-1.0/Conn.c Examining data/pconsole-1.0/terminal.c Examining data/pconsole-1.0/cstring.c Examining data/pconsole-1.0/commands.c Examining data/pconsole-1.0/List.c Examining data/pconsole-1.0/include/commands.h Examining data/pconsole-1.0/include/cstring.h Examining data/pconsole-1.0/include/pconsole.h Examining data/pconsole-1.0/include/terminal.h Examining data/pconsole-1.0/include/Conn.h Examining data/pconsole-1.0/include/List.h Examining data/pconsole-1.0/pconsole.c FINAL RESULTS: data/pconsole-1.0/commands.c:63:2: [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(cmd, buf); data/pconsole-1.0/commands.c:240:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "\r\n[pconsole attached from tty %s]\r\n", tty); data/pconsole-1.0/commands.c:321:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "\r\n[pconsole detached from tty %s]\r\n", (tty == NULL) ? "(unknown)" : tty); data/pconsole-1.0/cstring.c:50:2: [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(str, s); data/pconsole-1.0/commands.c:60:1: [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 cmd[4096], **arr, *cmd_str; data/pconsole-1.0/commands.c:194:1: [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 *arr[2]; data/pconsole-1.0/commands.c:222:1: [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 *tty, *devname, buf[256]; data/pconsole-1.0/commands.c:299:16: [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). if ((c->fd = open(devname, O_RDWR)) == -1) { data/pconsole-1.0/commands.c:313:1: [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 *tty, buf[256]; data/pconsole-1.0/cstring.c:57:8: [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 char buf[64]; data/pconsole-1.0/cstring.c:59:2: [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(buf, "error #%d\n", err); data/pconsole-1.0/pconsole.c:46:1: [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 buf[256], *p; data/pconsole-1.0/terminal.c:45: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(&ori_term, &term, sizeof(struct termios)); data/pconsole-1.0/terminal.c:56: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(&term, &ori_term, sizeof(struct termios)); data/pconsole-1.0/commands.c:73:8: [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). len = strlen(arr[0]); data/pconsole-1.0/commands.c:144:10: [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). len = strlen(argv[j]); data/pconsole-1.0/commands.c:241:8: [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). len = strlen(buf); data/pconsole-1.0/commands.c:322:8: [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). len = strlen(buf); data/pconsole-1.0/cstring.c:48:28: [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 ((str = (char *)malloc(strlen(s)+1)) == NULL) data/pconsole-1.0/cstring.c:73: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). memmove(p, p+1, strlen(p)+1); data/pconsole-1.0/cstring.c:77:6: [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). i = strlen(msg); data/pconsole-1.0/pconsole.c:100:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(read(fileno(stdin), &kar, 1) > 0) { ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 1385 in approximately 0.05 seconds (25768 lines/second) Physical Source Lines of Code (SLOC) = 870 Hits@level = [0] 63 [1] 8 [2] 10 [3] 0 [4] 4 [5] 0 Hits@level+ = [0+] 85 [1+] 22 [2+] 14 [3+] 4 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 97.7011 [1+] 25.2874 [2+] 16.092 [3+] 4.5977 [4+] 4.5977 [5+] 0 Symlinks skipped = 1 (--allowlink overrides but see doc for security issue) 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.