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/avr-evtd-1.7.7/avr-evtd.c FINAL RESULTS: data/avr-evtd-1.7.7/avr-evtd.c:273:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strEventScript, "/etc/avr-evtd/EventScript %c %s %d &", data/avr-evtd-1.7.7/avr-evtd.c:275:2: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(strEventScript); data/avr-evtd-1.7.7/avr-evtd.c:699:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(avr_device, "%s", *argv); data/avr-evtd-1.7.7/avr-evtd.c:835:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strRoot, "%s", data/avr-evtd-1.7.7/avr-evtd.c:840:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strWorking, "%s", data/avr-evtd-1.7.7/avr-evtd.c:1218:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(rootPartition, "/dev/%s", data/avr-evtd-1.7.7/avr-evtd.c:1222:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(workingPartition, data/avr-evtd-1.7.7/avr-evtd.c:112: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 rootPartition[10] = ""; /* Default, no defaults for both root data/avr-evtd-1.7.7/avr-evtd.c:114: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 workingPartition[10] = ""; data/avr-evtd-1.7.7/avr-evtd.c:166: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 output[4]; data/avr-evtd-1.7.7/avr-evtd.c:181:19: [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). FileDescriptor = open(device, O_RDWR | O_NOCTTY); data/avr-evtd-1.7.7/avr-evtd.c:271: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 strEventScript[45]; data/avr-evtd-1.7.7/avr-evtd.c:288: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[17]; data/avr-evtd-1.7.7/avr-evtd.c:788:9: [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 strRoot[16]; data/avr-evtd-1.7.7/avr-evtd.c:789:9: [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 strWorking[16]; data/avr-evtd-1.7.7/avr-evtd.c:800: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 buff[4096]; data/avr-evtd-1.7.7/avr-evtd.c:806:10: [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). file = open("/etc/mtab", O_RDONLY); data/avr-evtd-1.7.7/avr-evtd.c:1439: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 message[80]; data/avr-evtd-1.7.7/avr-evtd.c:1477:3: [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(message, "Timer is set with %02d/%02d %02d:%02d", data/avr-evtd-1.7.7/avr-evtd.c:1562: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 buff[4096]; data/avr-evtd-1.7.7/avr-evtd.c:1589:9: [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). open("/etc/melco/timer_status", data/avr-evtd-1.7.7/avr-evtd.c:1603:9: [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). open("/etc/melco/timer_sleep", data/avr-evtd-1.7.7/avr-evtd.c:1647:9: [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). open(config_file_location, data/avr-evtd-1.7.7/avr-evtd.c:365:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). iResult = read(FileDescriptor, buf, 16); data/avr-evtd-1.7.7/avr-evtd.c:759:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); data/avr-evtd-1.7.7/avr-evtd.c:810:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). iRead = read(file, buff, 4095); data/avr-evtd-1.7.7/avr-evtd.c:858: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). if (strlen(strRoot) > 0) { data/avr-evtd-1.7.7/avr-evtd.c:876: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). if (strlen(strWorking) > 0) { data/avr-evtd-1.7.7/avr-evtd.c:1021:9: [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). j = strlen(pos); data/avr-evtd-1.7.7/avr-evtd.c:1213: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). if (strlen(pos) <= 5) { data/avr-evtd-1.7.7/avr-evtd.c:1593:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). iRead = read(file, buff, 254); data/avr-evtd-1.7.7/avr-evtd.c:1607:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). iRead = read(file, buff, 31); data/avr-evtd-1.7.7/avr-evtd.c:1651:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). iRead = read(file, buff, 4095); ANALYSIS SUMMARY: Hits = 33 Lines analyzed = 1681 in approximately 0.04 seconds (37880 lines/second) Physical Source Lines of Code (SLOC) = 1152 Hits@level = [0] 17 [1] 10 [2] 16 [3] 0 [4] 7 [5] 0 Hits@level+ = [0+] 50 [1+] 33 [2+] 23 [3+] 7 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 43.4028 [1+] 28.6458 [2+] 19.9653 [3+] 6.07639 [4+] 6.07639 [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.