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/lwt-5.3.0/src/unix/lwt_config.h Examining data/lwt-5.3.0/src/unix/lwt_libev_stubs.c Examining data/lwt-5.3.0/src/unix/lwt_process_stubs.c Examining data/lwt-5.3.0/src/unix/lwt_unix.h Examining data/lwt-5.3.0/src/unix/lwt_unix_stubs.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_accept4.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_access_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bind_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_read.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_read_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_recv.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_recvfrom.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_send.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_sendto.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_sendto_byte.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_write.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_bytes_write_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_chdir_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_chmod_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_chown_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_chroot_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_close_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_closedir_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_fchmod_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_fchown_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_fdatasync_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_fstat_64_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_fstat_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_fsync_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_ftruncate_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_get_affinity.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_get_cpu.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_get_credentials.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_get_network_information_utils.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_get_network_information_utils.h Examining data/lwt-5.3.0/src/unix/unix_c/unix_get_page_size.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_get_pw_gr_nam_id_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_getaddrinfo_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_getcwd_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_gethostbyaddr_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_gethostbyname_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_gethostname_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_getlogin_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_getnameinfo_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_getprotoby_getservby_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_guess_blocking_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_invalidate_dir.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_iov_max.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_isatty_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_link_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_lockf_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_lseek_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_lstat_64_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_lstat_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_madvise.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_mcast_modify_membership.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_mcast_set_loop.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_mcast_set_ttl.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_mcast_utils.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_mcast_utils.h Examining data/lwt-5.3.0/src/unix/unix_c/unix_mincore.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_mkdir_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_mkfifo_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_not_available.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_open_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_opendir_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_pread.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_pread_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_pwrite.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_pwrite_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_read.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_read_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readable.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readdir_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readdir_n_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readlink_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readv.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readv_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readv_writev_utils.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_readv_writev_utils.h Examining data/lwt-5.3.0/src/unix/unix_c/unix_recv.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_recv_msg.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_recv_send_utils.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_recv_send_utils.h Examining data/lwt-5.3.0/src/unix/unix_c/unix_recvfrom.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_rename_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_rewinddir_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_rmdir_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_send.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_send_msg.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_sendto.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_sendto_byte.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_set_affinity.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_somaxconn.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_stat_64_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_stat_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_stat_job_utils.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_stat_job_utils.h Examining data/lwt-5.3.0/src/unix/unix_c/unix_symlink_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_tcdrain_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_tcflow_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_tcflush_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_tcgetattr_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_tcsendbreak_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_tcsetattr_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_termios_conversion.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_termios_conversion.h Examining data/lwt-5.3.0/src/unix/unix_c/unix_truncate_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_unlink_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_utimes_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_valid_dir.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_wait4.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_wait_mincore_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_writable.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_write.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_write_job.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_writev.c Examining data/lwt-5.3.0/src/unix/unix_c/unix_writev_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_bytes_read.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_bytes_read_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_bytes_write.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_bytes_write_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_fsync_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_get_page_size.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_is_socket.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_not_available.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_pread.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_pread_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_pwrite.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_pwrite_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_read.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_read_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_somaxconn.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_system_job.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_write.c Examining data/lwt-5.3.0/src/unix/windows_c/windows_write_job.c FINAL RESULTS: data/lwt-5.3.0/src/unix/unix_c/unix_chmod_job.c:57:17: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. job->result = chmod(job->path, job->mode); data/lwt-5.3.0/src/unix/unix_c/unix_chown_job.c:59:17: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. job->result = chown(job->path, job->ower, job->group); data/lwt-5.3.0/src/unix/unix_c/unix_readlink_job.c:33:23: [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. link_length = readlink(job->name, job->buffer, buffer_size); data/lwt-5.3.0/src/unix/unix_c/unix_readlink_job.c:63:35: [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. LWT_UNIX_INIT_JOB_STRING(job, readlink, 0, name); data/lwt-5.3.0/src/unix/unix_c/unix_access_job.c:84: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. job->result = access(job->path, job->mode); data/lwt-5.3.0/src/unix/unix_c/unix_getlogin_job.c:45:28: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. LWT_UNIX_INIT_JOB(job, getlogin, 0); data/lwt-5.3.0/src/unix/windows_c/windows_system_job.c:54:32: [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. LWT_UNIX_INIT_JOB(job, system, 0); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:245:3: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(mutex); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:252:51: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. void lwt_unix_mutex_lock(lwt_unix_mutex *mutex) { EnterCriticalSection(mutex); } data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:269:3: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(&condition->mutex); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:279:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&condition->mutex); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:291:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&condition->mutex); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:306:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&condition->mutex); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:321:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(mutex); data/lwt-5.3.0/src/unix/unix_c/unix_chroot_job.c:55:17: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. job->result = chroot(job->path); data/lwt-5.3.0/src/unix/windows_c/windows_system_job.c:49:10: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. if (!CreateProcess(NULL, String_val(cmdline), NULL, NULL, TRUE, 0, NULL, data/lwt-5.3.0/src/unix/windows_c/windows_system_job.c:49:10: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. if (!CreateProcess(NULL, String_val(cmdline), NULL, NULL, TRUE, 0, NULL, data/lwt-5.3.0/src/unix/lwt_unix.h:257: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(VAR->ARG, String_val(ARG), __len + 1) data/lwt-5.3.0/src/unix/lwt_unix.h:271: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(VAR->ARG1, String_val(ARG1), __len1 + 1); \ data/lwt-5.3.0/src/unix/lwt_unix.h:272: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(VAR->ARG2, String_val(ARG2), __len2 + 1) data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:119:3: [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((char *)Caml_ba_data_val(val_buf2) + Long_val(val_ofs2), data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:134:3: [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(Lwt_bytes_val(val_buf2) + Long_val(val_ofs2), data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:469:3: [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((void *)new_notifications, (void *)notifications, data/lwt-5.3.0/src/unix/unix_c/unix_access_job.c:119:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_chdir_job.c:90:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_chmod_job.c:92:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_chown_job.c:94:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_chroot_job.c:90:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_get_network_information_utils.c:46: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(p[i], src[i], addr_len); data/lwt-5.3.0/src/unix/unix_c/unix_getaddrinfo_job.c:49: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(&sa.s_gen, a->ai_addr, len); data/lwt-5.3.0/src/unix/unix_c/unix_getcwd_job.c:114: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[4096]; data/lwt-5.3.0/src/unix/unix_c/unix_gethostbyaddr_job.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 buffer[NETDB_BUFFER_SIZE]; data/lwt-5.3.0/src/unix/unix_c/unix_gethostbyname_job.c:28: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 buffer[NETDB_BUFFER_SIZE]; data/lwt-5.3.0/src/unix/unix_c/unix_getlogin_job.c:21: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 buffer[1024]; data/lwt-5.3.0/src/unix/unix_c/unix_getnameinfo_job.c:26: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 host[4096]; data/lwt-5.3.0/src/unix/unix_c/unix_getnameinfo_job.c:27: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 serv[1024]; data/lwt-5.3.0/src/unix/unix_c/unix_link_job.c:96:3: [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(job->oldpath, String_val(oldpath), len_oldpath); data/lwt-5.3.0/src/unix/unix_c/unix_link_job.c:98:3: [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(job->newpath, String_val(newpath), len_newpath); data/lwt-5.3.0/src/unix/unix_c/unix_mcast_modify_membership.c:43: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(&mreq.imr_multiaddr, &GET_INET_ADDR(group_addr), 4); data/lwt-5.3.0/src/unix/unix_c/unix_mcast_modify_membership.c:44: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(&mreq.imr_interface, &GET_INET_ADDR(if_addr), 4); data/lwt-5.3.0/src/unix/unix_c/unix_mkdir_job.c:93:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_mkfifo_job.c:93:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_open_job.c:77: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). fd = open(job->name, job->flags, job->perms); data/lwt-5.3.0/src/unix/unix_c/unix_open_job.c:114:35: [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). LWT_UNIX_INIT_JOB_STRING(job, open, 0, name); data/lwt-5.3.0/src/unix/unix_c/unix_pread_job.c:59: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(Bytes_val(job->string) + job->offset, job->buffer, result); data/lwt-5.3.0/src/unix/unix_c/unix_pwrite_job.c:50: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(job->buffer, String_val(val_string) + Long_val(val_offset), length); data/lwt-5.3.0/src/unix/unix_c/unix_read_job.c:57: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(Bytes_val(job->string) + job->offset, job->buffer, result); data/lwt-5.3.0/src/unix/unix_c/unix_readv_job.c:52: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(&Byte(String_val(read_buffer->caml_buffer), data/lwt-5.3.0/src/unix/unix_c/unix_readv_writev_utils.c:43:17: [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(buffer_copies[copy_index], data/lwt-5.3.0/src/unix/unix_c/unix_readv_writev_utils.c:64:20: [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 *)Caml_ba_data_val(buffer))[offset]; data/lwt-5.3.0/src/unix/unix_c/unix_rename_job.c:96:3: [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(job->oldpath, String_val(oldpath), len_oldpath); data/lwt-5.3.0/src/unix/unix_c/unix_rename_job.c:98:3: [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(job->newpath, String_val(newpath), len_newpath); data/lwt-5.3.0/src/unix/unix_c/unix_rmdir_job.c:90:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_symlink_job.c:96:3: [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(job->oldpath, String_val(oldpath), len_oldpath); data/lwt-5.3.0/src/unix/unix_c/unix_symlink_job.c:98:3: [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(job->newpath, String_val(newpath), len_newpath); data/lwt-5.3.0/src/unix/unix_c/unix_tcsetattr_job.c:55: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(&job->termios, &Field(termios, 0), NFIELDS * sizeof(value)); data/lwt-5.3.0/src/unix/unix_c/unix_truncate_job.c:93:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_truncate_job.c:113:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_unlink_job.c:90:3: [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(job->path, String_val(path), len_path); data/lwt-5.3.0/src/unix/unix_c/unix_wait_mincore_job.c:31: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(&dummy, job->ptr, 1); data/lwt-5.3.0/src/unix/unix_c/unix_write_job.c:47: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(job->buffer, String_val(val_string) + Long_val(val_offset), length); data/lwt-5.3.0/src/unix/windows_c/windows_pread_job.c:56: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(Bytes_val(job->string) + job->offset, job->buffer, job->result); data/lwt-5.3.0/src/unix/windows_c/windows_pwrite_job.c:65: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( data/lwt-5.3.0/src/unix/windows_c/windows_read_job.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(Bytes_val(job->string) + job->offset, job->buffer, job->result); data/lwt-5.3.0/src/unix/windows_c/windows_write_job.c:68: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(job->buffer, String_val(val_string) + Long_val(val_offset), length); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:659:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(notification_fd, (char *)&buf, 8); data/lwt-5.3.0/src/unix/lwt_unix_stubs.c:673:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(notification_fds[0], &buf, 1); data/lwt-5.3.0/src/unix/unix_c/unix_bytes_read.c:18:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(Int_val(val_fd), data/lwt-5.3.0/src/unix/unix_c/unix_bytes_read_job.c:38:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). job->result = read(job->fd, job->buffer, job->length); data/lwt-5.3.0/src/unix/unix_c/unix_read.c:17:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(Int_val(val_fd), &Byte(String_val(val_buf), Long_val(val_ofs)), data/lwt-5.3.0/src/unix/unix_c/unix_read_job.c:44:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). job->result = read(job->fd, job->buffer, job->length); data/lwt-5.3.0/src/unix/unix_c/unix_read_job.c:68:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). LWT_UNIX_INIT_JOB(job, read, length); data/lwt-5.3.0/src/unix/windows_c/windows_read_job.c:72:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). LWT_UNIX_INIT_JOB(job, read, length); ANALYSIS SUMMARY: Hits = 73 Lines analyzed = 10685 in approximately 0.33 seconds (32725 lines/second) Physical Source Lines of Code (SLOC) = 6933 Hits@level = [0] 14 [1] 8 [2] 48 [3] 10 [4] 3 [5] 4 Hits@level+ = [0+] 87 [1+] 73 [2+] 65 [3+] 17 [4+] 7 [5+] 4 Hits/KSLOC@level+ = [0+] 12.5487 [1+] 10.5294 [2+] 9.37545 [3+] 2.45204 [4+] 1.00966 [5+] 0.576951 Dot directories skipped = 2 (--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.