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/libfixposix-0.4.3/src/include/lfp.h Examining data/libfixposix-0.4.3/src/include/lfp/aux.h Examining data/libfixposix-0.4.3/src/include/lfp/buildinfo.h Examining data/libfixposix-0.4.3/src/include/lfp/dirent.h Examining data/libfixposix-0.4.3/src/include/lfp/errno.h Examining data/libfixposix-0.4.3/src/include/lfp/fcntl.h Examining data/libfixposix-0.4.3/src/include/lfp/ioctl.h Examining data/libfixposix-0.4.3/src/include/lfp/mman.h Examining data/libfixposix-0.4.3/src/include/lfp/resource.h Examining data/libfixposix-0.4.3/src/include/lfp/select.h Examining data/libfixposix-0.4.3/src/include/lfp/sendfile.h Examining data/libfixposix-0.4.3/src/include/lfp/signal.h Examining data/libfixposix-0.4.3/src/include/lfp/signalfd.h Examining data/libfixposix-0.4.3/src/include/lfp/socket.h Examining data/libfixposix-0.4.3/src/include/lfp/spawn.h Examining data/libfixposix-0.4.3/src/include/lfp/stat.h Examining data/libfixposix-0.4.3/src/include/lfp/stdlib.h Examining data/libfixposix-0.4.3/src/include/lfp/strerror.h Examining data/libfixposix-0.4.3/src/include/lfp/string.h Examining data/libfixposix-0.4.3/src/include/lfp/syslog.h Examining data/libfixposix-0.4.3/src/include/lfp/unistd.h Examining data/libfixposix-0.4.3/src/include/lfp/wait.h Examining data/libfixposix-0.4.3/src/lib/aux/inlines.h Examining data/libfixposix-0.4.3/src/lib/aux/macros.h Examining data/libfixposix-0.4.3/src/lib/bitset.c Examining data/libfixposix-0.4.3/src/lib/bitset.h Examining data/libfixposix-0.4.3/src/lib/dirent.c Examining data/libfixposix-0.4.3/src/lib/errno.c Examining data/libfixposix-0.4.3/src/lib/fcntl.c Examining data/libfixposix-0.4.3/src/lib/install_signalfd.c Examining data/libfixposix-0.4.3/src/lib/ioctl.c Examining data/libfixposix-0.4.3/src/lib/mman.c Examining data/libfixposix-0.4.3/src/lib/resource.c Examining data/libfixposix-0.4.3/src/lib/select.c Examining data/libfixposix-0.4.3/src/lib/sendfile.c Examining data/libfixposix-0.4.3/src/lib/signal.c Examining data/libfixposix-0.4.3/src/lib/socket.c Examining data/libfixposix-0.4.3/src/lib/spawn.c Examining data/libfixposix-0.4.3/src/lib/spawn.h Examining data/libfixposix-0.4.3/src/lib/spawn_file_actions.c Examining data/libfixposix-0.4.3/src/lib/spawnattr.c Examining data/libfixposix-0.4.3/src/lib/stat.c Examining data/libfixposix-0.4.3/src/lib/stdlib.c Examining data/libfixposix-0.4.3/src/lib/strerror.c Examining data/libfixposix-0.4.3/src/lib/string.c Examining data/libfixposix-0.4.3/src/lib/syslog.c Examining data/libfixposix-0.4.3/src/lib/time.c Examining data/libfixposix-0.4.3/src/lib/unistd.c Examining data/libfixposix-0.4.3/src/lib/wait.c Examining data/libfixposix-0.4.3/src/tests/buildinfo.c Examining data/libfixposix-0.4.3/src/tests/mkstemp.c Examining data/libfixposix-0.4.3/src/tests/select.c Examining data/libfixposix-0.4.3/src/tests/signalfd.c Examining data/libfixposix-0.4.3/src/tests/spawn.c FINAL RESULTS: data/libfixposix-0.4.3/src/include/lfp/buildinfo.h:35: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 vcsid[32+1]; data/libfixposix-0.4.3/src/include/lfp/spawn.h:128:21: [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. const char *restrict path, data/libfixposix-0.4.3/src/include/lfp/spawn.h:129:15: [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 *const argv[restrict], data/libfixposix-0.4.3/src/include/lfp/spawn.h:130:15: [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 *const envp[restrict], data/libfixposix-0.4.3/src/include/lfp/spawn.h:135:22: [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. const char *restrict file, data/libfixposix-0.4.3/src/include/lfp/spawn.h:136:16: [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 *const argv[restrict], data/libfixposix-0.4.3/src/include/lfp/spawn.h:137:16: [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 *const envp[restrict], data/libfixposix-0.4.3/src/lib/fcntl.c:40: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). return open(pathname, (int)flags & 0xFFFFFFFF, mode); data/libfixposix-0.4.3/src/lib/fcntl.c:42: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). return open(pathname, (int)flags & 0xFFFFFFFF); data/libfixposix-0.4.3/src/lib/install_signalfd.c:79: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 msg[128]; data/libfixposix-0.4.3/src/lib/spawn.c:106:18: [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. const char *restrict path, data/libfixposix-0.4.3/src/lib/spawn.c:107: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. char *const argv[restrict], data/libfixposix-0.4.3/src/lib/spawn.c:108: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. char *const envp[restrict], data/libfixposix-0.4.3/src/lib/spawn.c:122:16: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. *pid = vfork(); data/libfixposix-0.4.3/src/lib/spawn.c:141:17: [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. const char *restrict path, data/libfixposix-0.4.3/src/lib/spawn.c:142: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. char *const argv[restrict], data/libfixposix-0.4.3/src/lib/spawn.c:143: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. char *const envp[restrict], data/libfixposix-0.4.3/src/lib/spawn.c:154:18: [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. const char *restrict file, data/libfixposix-0.4.3/src/lib/spawn.c:155: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. char *const argv[restrict], data/libfixposix-0.4.3/src/lib/spawn.c:156: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. char *const envp[restrict], data/libfixposix-0.4.3/src/lib/spawn_file_actions.c:112:13: [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(new_actions, actions, allocated * sizeof(lfp_spawn_action)); data/libfixposix-0.4.3/src/lib/spawnattr.c:95: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(sigmask, &attr->sigmask, sizeof(sigset_t)); data/libfixposix-0.4.3/src/lib/spawnattr.c:104: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(&attr->sigmask, sigmask, sizeof(sigset_t)); data/libfixposix-0.4.3/src/lib/spawnattr.c:112: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(sigdefault, &attr->sigdefault, sizeof(sigset_t)); data/libfixposix-0.4.3/src/lib/spawnattr.c:121: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(&attr->sigdefault, sigdefault, sizeof(sigset_t)); data/libfixposix-0.4.3/src/lib/stdlib.c:57: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 random_value[6]; data/libfixposix-0.4.3/src/lib/stdlib.c:58: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(random_value, &internalSeed, 4); data/libfixposix-0.4.3/src/lib/stdlib.c:60: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(random_value + 4, &internalSeed, 2); data/libfixposix-0.4.3/src/lib/stdlib.c:172:9: [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(buf, pts, ptslen); data/libfixposix-0.4.3/src/lib/string.c:61:13: [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(newstr, s, len); data/libfixposix-0.4.3/src/lib/unistd.c:203: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 path[PATH_MAX]; data/libfixposix-0.4.3/src/tests/mkstemp.c:30:9: [2] (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). Risk is low because the source is a constant string. strcpy(tempfiles[i],"/tmp/aaaXXXXXX"); data/libfixposix-0.4.3/src/tests/spawn.c:29: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[256]; data/libfixposix-0.4.3/src/tests/spawn.c:32:21: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ( (tempfd1 = mkstemp(tempnam1)) == -1 ) { data/libfixposix-0.4.3/src/tests/spawn.c:35:21: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ( (tempfd2 = mkstemp(tempnam2)) == -1 ) { data/libfixposix-0.4.3/src/tests/spawn.c:67:15: [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). tempfd2 = open(tempnam2, O_RDONLY); data/libfixposix-0.4.3/src/lib/spawn.c:85:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int noctets = read(pipes[0], &child_errno, sizeof(int)); data/libfixposix-0.4.3/src/lib/stdlib.c:92:18: [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 len = strlen(template); data/libfixposix-0.4.3/src/lib/syslog.c:52:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(syslog_ident, ident, SYSLOG_IDENT_SIZE - 1); data/libfixposix-0.4.3/src/lib/unistd.c:201:22: [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 filelen = strlen(file); data/libfixposix-0.4.3/src/tests/signalfd.c:30:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). s = read(fd, buf, count); data/libfixposix-0.4.3/src/tests/spawn.c:69:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). err = read(tempfd2,buf,sizeof(buf)); ANALYSIS SUMMARY: Hits = 42 Lines analyzed = 4392 in approximately 0.18 seconds (24172 lines/second) Physical Source Lines of Code (SLOC) = 2545 Hits@level = [0] 18 [1] 6 [2] 36 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 60 [1+] 42 [2+] 36 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 23.5756 [1+] 16.5029 [2+] 14.1454 [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.