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/libite-2.2.0/src/rsync.c Examining data/libite-2.2.0/src/fexist.c Examining data/libite-2.2.0/src/telnet.c Examining data/libite-2.2.0/src/strnlen.h Examining data/libite-2.2.0/src/strdupa.h Examining data/libite-2.2.0/src/copyfile.c Examining data/libite-2.2.0/src/makepath.c Examining data/libite-2.2.0/src/yorn.c Examining data/libite-2.2.0/src/tree.h Examining data/libite-2.2.0/src/strtonum.c Examining data/libite-2.2.0/src/strlcpy.c Examining data/libite-2.2.0/src/strlcat.c Examining data/libite-2.2.0/src/pidfile.c Examining data/libite-2.2.0/src/pidfilefn.c Examining data/libite-2.2.0/src/strndupa.h Examining data/libite-2.2.0/src/tempfile.c Examining data/libite-2.2.0/src/systemf.c Examining data/libite-2.2.0/src/lite.h Examining data/libite-2.2.0/src/lfile.c Examining data/libite-2.2.0/src/conio.h Examining data/libite-2.2.0/src/fisdir.c Examining data/libite-2.2.0/src/which.c Examining data/libite-2.2.0/src/ifconfig.c Examining data/libite-2.2.0/src/strmatch.c Examining data/libite-2.2.0/src/queue.h Examining data/libite-2.2.0/src/reallocarray.c Examining data/libite-2.2.0/src/chomp.c Examining data/libite-2.2.0/src/progress.c Examining data/libite-2.2.0/src/conio.c Examining data/libite-2.2.0/src/fparseln.c Examining data/libite-2.2.0/src/fopenf.c Examining data/libite-2.2.0/src/dir.c Examining data/libite-2.2.0/src/strlite.h Examining data/libite-2.2.0/src/fsendfile.c Examining data/libite-2.2.0/tests/rsync.c Examining data/libite-2.2.0/tests/copyfile.c Examining data/libite-2.2.0/tests/makepath.c Examining data/libite-2.2.0/tests/yorn.c Examining data/libite-2.2.0/tests/printhdr.c Examining data/libite-2.2.0/tests/pidfile.c Examining data/libite-2.2.0/tests/touch.c Examining data/libite-2.2.0/tests/tempfile.c Examining data/libite-2.2.0/tests/systemf.c Examining data/libite-2.2.0/tests/fisdir.c Examining data/libite-2.2.0/tests/strmatch.c Examining data/libite-2.2.0/tests/chomp.c Examining data/libite-2.2.0/tests/progress.c Examining data/libite-2.2.0/tests/str.c Examining data/libite-2.2.0/tests/fopenf.c Examining data/libite-2.2.0/tests/dir.c Examining data/libite-2.2.0/tests/check.h Examining data/libite-2.2.0/tests/fsendfile.c Examining data/libite-2.2.0/tests/fexist.c Examining data/libite-2.2.0/tests/lfile.c Examining data/libite-2.2.0/tests/which.c FINAL RESULTS: data/libite-2.2.0/src/copyfile.c:152:10: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. size = readlink(src, buffer, BUFSIZ); data/libite-2.2.0/tests/dir.c:48:13: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. int len = readlink(STARTUP_CONFIG, file, sizeof(file)); data/libite-2.2.0/src/copyfile.c:52:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp, "%s%s%s", *dst, slash ? "" : "/", ptr); data/libite-2.2.0/src/fexist.c:41:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (-1 == access(file, F_OK)) data/libite-2.2.0/src/fopenf.c:42:8: [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. len = vsnprintf(NULL, 0, fmt, ap); data/libite-2.2.0/src/fopenf.c:48:3: [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(file, len + 1, fmt, ap); data/libite-2.2.0/src/makepath.c:69:8: [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. len = vsnprintf(NULL, 0, fmt, ap); data/libite-2.2.0/src/makepath.c:77:8: [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. len = vsnprintf(path, len + 1, fmt, ap); data/libite-2.2.0/src/pidfile.c:68:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(pidfile_path, R_OK) && pid == pidfile_pid) { data/libite-2.2.0/src/systemf.c:32:8: [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. len = vsnprintf(NULL, 0, fmt, ap); data/libite-2.2.0/src/systemf.c:43: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(cmd, len, fmt, ap); data/libite-2.2.0/src/systemf.c:46:11: [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. status = system(cmd); data/libite-2.2.0/src/telnet.c:31:29: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define TELL(fmt, args...) fprintf (stderr, fmt "\n", ##args) data/libite-2.2.0/src/which.c:59:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path, X_OK)) data/libite-2.2.0/src/which.c:91:17: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!path || !access(path, X_OK)) { data/libite-2.2.0/src/yorn.c:74:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, ap); data/libite-2.2.0/tests/check.h:12:37: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define PRINT(args...) if (verbose) printf(args) data/libite-2.2.0/tests/check.h:17:7: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, \ data/libite-2.2.0/tests/check.h:36:8: [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. len = vsnprintf(buf, sizeof(buf), fmt, ap); data/libite-2.2.0/tests/dir.c:71:4: [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("ls -l *" DIR_TYPE_CONFIG); data/libite-2.2.0/tests/dir.c:75:4: [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("ls -l *" DIR_TYPE_IMAGE); data/libite-2.2.0/tests/dir.c:79:4: [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("ls -l *"); data/libite-2.2.0/tests/fsendfile.c:23:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(files[i + 1], F_OK)) data/libite-2.2.0/tests/makepath.c:15:6: [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. if (system(tmp)) data/libite-2.2.0/tests/makepath.c:78: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("rm -rf " BASEDIR); data/libite-2.2.0/tests/rsync.c:24: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("rm -rf " BASE); data/libite-2.2.0/tests/rsync.c:43:3: [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(cmd); data/libite-2.2.0/tests/rsync.c:47:3: [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(cmd); data/libite-2.2.0/tests/tempfile.c:8:74: [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. #warning O_TMPFILE is missing, either too old GLIBC, Linux, or non-Linux system data/libite-2.2.0/tests/tempfile.c:21:8: [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. ret = system("ls -lrt " _PATH_TMP " | tail -3"); data/libite-2.2.0/tests/tempfile.c:33:8: [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. ret = system("ls -lrt " _PATH_TMP " | tail -3"); data/libite-2.2.0/src/which.c:68:8: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. ptr = getenv("PATH"); data/libite-2.2.0/src/copyfile.c:174:7: [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). in = open(src, O_RDONLY); data/libite-2.2.0/src/copyfile.c:180:8: [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). out = open(dest, O_WRONLY | O_CREAT | O_TRUNC, st.st_mode); data/libite-2.2.0/src/fopenf.c:49:8: [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). fp = fopen(file, mode); data/libite-2.2.0/src/fparseln.c:71: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 * data/libite-2.2.0/src/fparseln.c:72:56: [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. fparseln(FILE *fp, size_t *size, size_t *lineno, const char str[3], int flags) data/libite-2.2.0/src/fparseln.c:74: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. static const char dstr[3] = { '\\', '\\', '#' }; data/libite-2.2.0/src/fparseln.c:157:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(buf + len, ptr, s); data/libite-2.2.0/src/lfile.c:26: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[256]; data/libite-2.2.0/src/lfile.c:51: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). lf->fp = fopen(file, "r"); data/libite-2.2.0/src/lfile.c:157:10: [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). return atoi(token); data/libite-2.2.0/src/lite.h:63: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 *fparseln (FILE *, size_t *, size_t *, const char[3], int); data/libite-2.2.0/src/pidfile.c:86:11: [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). if ((f = fopen(pidfile_path, "w")) == NULL) { data/libite-2.2.0/src/pidfilefn.c:41: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[16]; data/libite-2.2.0/src/pidfilefn.c:49:7: [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). fp = fopen(pidfile, "r"); data/libite-2.2.0/src/rsync.c:65: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 source[256]; data/libite-2.2.0/src/rsync.c:66: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 dest[256]; data/libite-2.2.0/src/rsync.c:109: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 dst2[256]; data/libite-2.2.0/src/strdupa.h:50:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (char *)memcpy(dst_, src, len_); \ data/libite-2.2.0/src/strndupa.h:51:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (char *)memcpy(dst_, src, len_); \ data/libite-2.2.0/src/tempfile.c:43:7: [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 = open(_PATH_TMP, O_TMPFILE | O_RDWR | O_EXCL | O_CLOEXEC, S_IRUSR | S_IWUSR); data/libite-2.2.0/src/tempfile.c:50:9: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). return tmpfile(); /* Fallback on older GLIBC/Linux and actual UNIX systems */ data/libite-2.2.0/tests/check.h:28: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[80]; data/libite-2.2.0/tests/copyfile.c:19:9: [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). src = fopen(files[i], "r"); data/libite-2.2.0/tests/copyfile.c:20:9: [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). dst = fopen(files[i + 1], "w"); data/libite-2.2.0/tests/dir.c:45: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 file[80]; data/libite-2.2.0/tests/fsendfile.c:17:23: [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). src = fopen(files[i], "r"); data/libite-2.2.0/tests/fsendfile.c:18:23: [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). dst = fopen(files[i + 1], "w"); data/libite-2.2.0/tests/lfile.c:27:18: [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). printf("%d ", atoi(token)); data/libite-2.2.0/tests/lfile.c:30:19: [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). printf("%d\n", atoi(token)); data/libite-2.2.0/tests/makepath.c:11: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 tmp[256]; data/libite-2.2.0/tests/makepath.c:43: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 tmp[256]; data/libite-2.2.0/tests/pidfile.c:14: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 PIDFILE[42]; data/libite-2.2.0/tests/pidfile.c:37: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[80]; data/libite-2.2.0/tests/printhdr.c:11: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[SCREEN_WIDTH]; data/libite-2.2.0/tests/rsync.c:30: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 cmd[256]; data/libite-2.2.0/tests/str.c:5: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[10]; data/libite-2.2.0/tests/tempfile.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 buf[80] = ""; data/libite-2.2.0/tests/touch.c:15: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[80]; data/libite-2.2.0/tests/touch.c:42: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 file[42] = "/tmp/touch_test.XXXXXX"; data/libite-2.2.0/tests/touch.c:47:7: [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). fd = mkstemp(file); data/libite-2.2.0/src/chomp.c:36:14: [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 || strlen(str) < 1) { data/libite-2.2.0/src/chomp.c:41:12: [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). p = str + strlen(str) - 1; data/libite-2.2.0/src/conio.h:99:23: [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). SCREEN_WIDTH - (int)strlen(line), ""); data/libite-2.2.0/src/copyfile.c:43:16: [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). tmp = malloc(strlen(*dst) + strlen(ptr) + 2); data/libite-2.2.0/src/copyfile.c:43:31: [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). tmp = malloc(strlen(*dst) + strlen(ptr) + 2); data/libite-2.2.0/src/copyfile.c:68:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(in, buffer, count); data/libite-2.2.0/src/dir.c:35:12: [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 ((1 == strlen(entry->d_name) && entry->d_name[0] == '.') || data/libite-2.2.0/src/dir.c:36:12: [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). (2 == strlen(entry->d_name) && !strcmp(entry->d_name, ".."))) data/libite-2.2.0/src/fparseln.c:193: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). len = strlen(buf); data/libite-2.2.0/src/lfile.c:134:32: [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 (!strncmp(token, key, MAX(strlen(token), strlen(key)))) data/libite-2.2.0/src/lfile.c:134:47: [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 (!strncmp(token, key, MAX(strlen(token), strlen(key)))) data/libite-2.2.0/src/lite.h:190: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(dir) > 0) data/libite-2.2.0/src/lite.h:191:16: [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). return dir[strlen(dir) - 1] == '/'; data/libite-2.2.0/src/pidfilefn.c:86:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(50000); /* Wait 50ms between retries */ data/libite-2.2.0/src/progress.c:37: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). num = strlen(style); data/libite-2.2.0/src/rsync.c:112:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(source, "/"); data/libite-2.2.0/src/rsync.c:184:37: [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 (!strncmp (files[n], file, MAX(strlen(files[n]), strlen(file)))) data/libite-2.2.0/src/rsync.c:184:55: [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 (!strncmp (files[n], file, MAX(strlen(files[n]), strlen(file)))) data/libite-2.2.0/src/rsync.c:204: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(files[i]) + 2 + strlen(dst); data/libite-2.2.0/src/rsync.c:204: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). size_t len = strlen(files[i]) + 2 + strlen(dst); data/libite-2.2.0/src/strdupa.h:47:16: [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(src); \ data/libite-2.2.0/src/strlcat.c:45:17: [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). return(dlen + strlen(src)); data/libite-2.2.0/src/strlite.h:88:16: [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). return s && strlen(s); data/libite-2.2.0/src/strlite.h:94:21: [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 min = MIN(strlen(a), strlen(b)); data/libite-2.2.0/src/strlite.h:94:32: [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 min = MIN(strlen(a), strlen(b)); data/libite-2.2.0/src/strlite.h:102:11: [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). return strlen(a) == strlen(b) && !strcmp(a, b); data/libite-2.2.0/src/strlite.h:102:24: [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). return strlen(a) == strlen(b) && !strcmp(a, b); data/libite-2.2.0/src/strlite.h:110:11: [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). return strlen (a) == strlen (b) && !strcasecmp (a, b); data/libite-2.2.0/src/strlite.h:110: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). return strlen (a) == strlen (b) && !strcasecmp (a, b); data/libite-2.2.0/src/strmatch.c:47:35: [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 (!strncasecmp (str, list[i], strlen (str))) data/libite-2.2.0/src/telnet.c:117:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(ctx->sd, &ctx->buf[tot], BUFSIZ); data/libite-2.2.0/src/telnet.c:156: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(script[i])) { data/libite-2.2.0/src/telnet.c:169:7: [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(script[i])) { data/libite-2.2.0/src/telnet.c:171:40: [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 (-1 == write(ctx->sd, script[i], strlen(script[i]))) { data/libite-2.2.0/src/telnet.c:202:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(ctx->sd, ctx->buf, BUFSIZ); data/libite-2.2.0/src/tempfile.c:42:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). oldmask = umask(0077); data/libite-2.2.0/src/tempfile.c:44:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(oldmask); data/libite-2.2.0/src/which.c:78:16: [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(tok) + strlen(cmd) + 2; data/libite-2.2.0/src/which.c:78:30: [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(tok) + strlen(cmd) + 2; data/libite-2.2.0/src/yorn.c:30:10: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return getchar(); data/libite-2.2.0/src/yorn.c:50:8: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). val = getchar(); data/libite-2.2.0/tests/check.h:43:33: [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). write(STDERR_FILENO, success, strlen(success)); data/libite-2.2.0/tests/check.h:45:33: [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). write(STDERR_FILENO, failure, strlen(failure)); data/libite-2.2.0/tests/check.h:74: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). pos = strlen(buf); data/libite-2.2.0/tests/chomp.c:17: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). len = strlen(str); data/libite-2.2.0/tests/makepath.c:75:33: [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). ret |= test_fmkpath(list[i] + strlen(BASEDIR) + 1); data/libite-2.2.0/tests/pidfile.c:40:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10000); data/libite-2.2.0/tests/progress.c:7:22: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. #define msleep(msec) usleep(msec * 1000) data/libite-2.2.0/tests/touch.c:23:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10000); ANALYSIS SUMMARY: Hits = 121 Lines analyzed = 6001 in approximately 0.25 seconds (24481 lines/second) Physical Source Lines of Code (SLOC) = 3660 Hits@level = [0] 63 [1] 49 [2] 40 [3] 1 [4] 29 [5] 2 Hits@level+ = [0+] 184 [1+] 121 [2+] 72 [3+] 32 [4+] 31 [5+] 2 Hits/KSLOC@level+ = [0+] 50.2732 [1+] 33.0601 [2+] 19.6721 [3+] 8.74317 [4+] 8.46995 [5+] 0.546448 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.