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/sysrqd-14/sysrqd.c FINAL RESULTS: data/sysrqd-14/sysrqd.c:49: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 pwd[PASS_MAX_LEN]; data/sysrqd-14/sysrqd.c:67:5: [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[PASS_MAX_LEN]; data/sysrqd-14/sysrqd.c:100:12: [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((fd = open (file, O_RDONLY)) == -1) data/sysrqd-14/sysrqd.c:155:3: [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 bindip[BIND_MAX_LEN]; data/sysrqd-14/sysrqd.c:243:16: [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 *pidf = fopen(PID_FILE, "w"); data/sysrqd-14/sysrqd.c:301:14: [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_sysrq = open(SYSRQ_TRIGGER_PATH, O_SYNC|O_WRONLY); data/sysrqd-14/sysrqd.c:74:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(sock_client, buf, sizeof(buf) - 1); data/sysrqd-14/sysrqd.c:109:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read (fd, buf, buflen - 1); data/sysrqd-14/sysrqd.c:138:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(read (sock_client, &buf, 1) == 1 && buf != 'q'); ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 319 in approximately 0.02 seconds (19404 lines/second) Physical Source Lines of Code (SLOC) = 214 Hits@level = [0] 13 [1] 3 [2] 6 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 22 [1+] 9 [2+] 6 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 102.804 [1+] 42.0561 [2+] 28.0374 [3+] 0 [4+] 0 [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.