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/tvoe-0.1/tvoe.c Examining data/tvoe-0.1/mpeg.h Examining data/tvoe-0.1/mpeg.c Examining data/tvoe-0.1/log.h Examining data/tvoe-0.1/log.c Examining data/tvoe-0.1/http.h Examining data/tvoe-0.1/http.c Examining data/tvoe-0.1/frontend.h Examining data/tvoe-0.1/frontend.c Examining data/tvoe-0.1/channels.h Examining data/tvoe-0.1/channels.c FINAL RESULTS: data/tvoe-0.1/log.c:30:2: [4] (format) vsnprintf: 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. vsnprintf(text, sizeof(text), fmt, args); data/tvoe-0.1/tvoe.c:31:13: [3] (buffer) getopt: 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. while((c = getopt(argc, argv, "qhfd:c:p:")) != -1) { data/tvoe-0.1/channels.c:14: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 *t[MAXTOKS]; data/tvoe-0.1/channels.c:33:14: [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 * fd = fopen(file, "r"); data/tvoe-0.1/channels.c:39: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 buf[2048]; data/tvoe-0.1/channels.c:57:4: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atoi(tok.t[8]), // delivery system data/tvoe-0.1/channels.c:58:4: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atoi(tok.t[1]) * 1000, // frequency data/tvoe-0.1/channels.c:59:4: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atoi(tok.t[4]) * 1000, // symbol rate data/tvoe-0.1/channels.c:60:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pol }, atoi(tok.t[7]) }; // polarization and SID data/tvoe-0.1/channels.c:61:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). http_add_channel(tok.t[0], atoi(tok.t[7]), l); data/tvoe-0.1/frontend.c:77: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 path_fe[512], path_dmx[512], path_dvr[512]; data/tvoe-0.1/frontend.c:85:18: [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((fe->fe_fd = open(path_fe, O_RDWR | O_NONBLOCK)) < 0 || data/tvoe-0.1/frontend.c:86:17: [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). (fe->dmx_fd = open(path_dmx, O_RDWR)) < 0 || data/tvoe-0.1/frontend.c:87:17: [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). (fe->dvr_fd = open(path_dvr, O_RDONLY | O_NONBLOCK)) < 0) { data/tvoe-0.1/frontend.c:210: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 * 188]; data/tvoe-0.1/http.c:76: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 text[128]; data/tvoe-0.1/log.c:18: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 text[2048], tv[256]; data/tvoe-0.1/log.c:45:12: [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). log_fd = fopen(logfile, "a"); data/tvoe-0.1/tvoe.c:94: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). int pidfd = open(pidfile, O_RDWR | O_CREAT, 0600); data/tvoe-0.1/tvoe.c:95: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 pid[8]; // PID is not greater than 65536 data/tvoe-0.1/frontend.c:219:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int n = read(fd, buf, sizeof(buf)); data/tvoe-0.1/tvoe.c:107:25: [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(write(pidfd, pid, strlen(pid)) != strlen(pid)) { data/tvoe-0.1/tvoe.c:107:41: [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(write(pidfd, pid, strlen(pid)) != strlen(pid)) { data/tvoe-0.1/tvoe.c:115:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 1206 in approximately 0.04 seconds (27046 lines/second) Physical Source Lines of Code (SLOC) = 826 Hits@level = [0] 13 [1] 4 [2] 18 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 37 [1+] 24 [2+] 20 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 44.7942 [1+] 29.0557 [2+] 24.2131 [3+] 2.42131 [4+] 1.21065 [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.