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/ocamlnet-4.1.8/src/netstring/netaccel_c.c Examining data/ocamlnet-4.1.8/src/netsys/config_posix.h Examining data/ocamlnet-4.1.8/src/netsys/config_win32.h Examining data/ocamlnet-4.1.8/src/netsys/netsys_c.h Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_clock.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_event.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_event.h Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_fadvise.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_fallocate.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_gprof.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_htab.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_htab.h Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_ioprio.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_ip6.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_locale.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_multicast.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_outofheap.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_poll.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_queue.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_queue.h Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_sem.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_shm.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_subprocess.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_syslog.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c_xdr.c Examining data/ocamlnet-4.1.8/src/netsys/unixsupport_w32.c Examining data/ocamlnet-4.1.8/src/netsys/config.h Examining data/ocamlnet-4.1.8/src/netsys/configtests/atfunctions.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/atfuns_mkfifoat.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/clock_gettime.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/epoll_create.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/eventfd.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/fchdir.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/fdopendir.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/gcc_compare_and_swap.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/getifaddrs.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/grantpt.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/initgroups.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/ocaml_fancy_page_tables.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_fadvise.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_fallocate.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_memalign.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_openpt.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_pthread.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_sem_anon.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_sem_named.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_shm.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/posix_spawn.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/realpath.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/syslog.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/timer_create.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/timerfd.c Examining data/ocamlnet-4.1.8/src/netsys/configtests/weak_modify.c Examining data/ocamlnet-4.1.8/src/netsys/netsys_c.c Examining data/ocamlnet-4.1.8/src/netcgi2-apache/apache.c Examining data/ocamlnet-4.1.8/src/netcgi2-apache/handler.c Examining data/ocamlnet-4.1.8/src/netcgi2-apache/wrappers.c Examining data/ocamlnet-4.1.8/src/netcgi2-apache/wrappers.h Examining data/ocamlnet-4.1.8/src/equeue-tcl/tclqueue.c Examining data/ocamlnet-4.1.8/src/equeue-tcl/tclqueue.h Examining data/ocamlnet-4.1.8/src/rpc-auth-local/rpclocal.c Examining data/ocamlnet-4.1.8/src/rpc-auth-local/configtests/getpeereid.c Examining data/ocamlnet-4.1.8/src/rpc-auth-local/configtests/getpeerucred.c Examining data/ocamlnet-4.1.8/src/rpc-xti/rpcxti.c Examining data/ocamlnet-4.1.8/src/nettls-gnutls/gnutls.c Examining data/ocamlnet-4.1.8/src/nettls-gnutls/nettle.c Examining data/ocamlnet-4.1.8/src/netgss-system/gssapi.c FINAL RESULTS: data/ocamlnet-4.1.8/src/netcgi2-apache/handler.c:74:7: [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 (argv[0], R_OK) == -1) data/ocamlnet-4.1.8/src/netsys/netsys_c.c:488:5: [4] (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). strcpy(p, String_val(path)); data/ocamlnet-4.1.8/src/netsys/netsys_c_locale.c:44:5: [4] (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). strcpy(oldcopy_locale, old_locale); data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:91:71: [4] (shell) execv: 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. CAMLprim value netsys_alloc_memory_pages(value addrv, value pv, value execv) data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:108:18: [4] (shell) execv: 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 (Bool_val(execv)) flags |= PROT_EXEC; data/ocamlnet-4.1.8/src/netsys/netsys_c_shm.c:41:5: [4] (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). strcpy(p, String_val(path)); data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c:369:5: [4] (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). strcpy(me.decoded.b_function, uerror_function); data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:22: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, list); data/ocamlnet-4.1.8/src/netsys/configtests/realpath.c:18:5: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. realpath("/", NULL); data/ocamlnet-4.1.8/src/netsys/netsys_c.c:279:18: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. name_out_s = realpath(name_in_s, NULL); /* Note: GNU extension! */ data/ocamlnet-4.1.8/src/netcgi2-apache/apache.c:711: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 buffer [huge_string_len]; data/ocamlnet-4.1.8/src/netcgi2-apache/apache.c:722: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 (String_val (str), buffer, i); data/ocamlnet-4.1.8/src/netcgi2-apache/handler.c:231: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 strtime[26]; data/ocamlnet-4.1.8/src/netgss-system/gssapi.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(buf->value, String_val(s) + Long_val(pos), buf->length); data/ocamlnet-4.1.8/src/netgss-system/gssapi.c:137: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(String_val(s), buf->value, buf->length); data/ocamlnet-4.1.8/src/netgss-system/gssapi.c:177: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(out->elements, buf->elements, buf->length); data/ocamlnet-4.1.8/src/netgss-system/gssapi.c:188: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(buf->elements, String_val(s), buf->length); data/ocamlnet-4.1.8/src/netgss-system/gssapi.c:200: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(String_val(s), buf->elements, buf->length); data/ocamlnet-4.1.8/src/netgss-system/gssapi.c:315: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(cb->initiator_address.value, String_val(iaddr), iaddr_len); data/ocamlnet-4.1.8/src/netgss-system/gssapi.c:319: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(cb->acceptor_address.value, String_val(aaddr), aaddr_len); data/ocamlnet-4.1.8/src/netgss-system/gssapi.c:322: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(cb->application_data.value, String_val(data), data_len); data/ocamlnet-4.1.8/src/netsys/configtests/atfunctions.c:23:11: [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). fd1 = open(".", O_RDONLY, 0); data/ocamlnet-4.1.8/src/netsys/configtests/atfuns_mkfifoat.c:19:11: [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). fd1 = open(".", O_RDONLY, 0); data/ocamlnet-4.1.8/src/netsys/configtests/fchdir.c:17: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(".", O_RDONLY, 0); data/ocamlnet-4.1.8/src/netsys/configtests/fdopendir.c:19: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(".", O_RDONLY, 0); data/ocamlnet-4.1.8/src/netsys/configtests/ocaml_fancy_page_tables.c:11: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 b[100000]; data/ocamlnet-4.1.8/src/netsys/configtests/posix_fadvise.c:16: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). j = open("posix_fadvise.tmp", O_RDWR | O_CREAT, 0666); data/ocamlnet-4.1.8/src/netsys/configtests/posix_fallocate.c:18: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). j = open("posix_fallocate.tmp", O_RDWR | O_CREAT, 0666); data/ocamlnet-4.1.8/src/netsys/configtests/posix_spawn.c:19: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 *argv[2]; data/ocamlnet-4.1.8/src/netsys/netsys_c.c:345: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("/dev/ptmx", flags); data/ocamlnet-4.1.8/src/netsys/netsys_c.h:115: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. CAMLextern unsigned char * caml_page_table[Pagetable1_size]; data/ocamlnet-4.1.8/src/netsys/netsys_c_clock.c:75:2: [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(out, s, sizeof(clockid_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_clock.c:190: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(s, &c, sizeof(clockid_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_clock.c:299:2: [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(String_val(v), (char *) &tm, sizeof(timer_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_clock.c:323: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((char *) out, String_val(v), sizeof(timer_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_event.c:399: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[1]; data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:836:7: [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(copy_header, work_header, work_bytes); data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:975:4: [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(copy_header, work_header, work_bytes); data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:1047:8: [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_header, data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:1050:8: [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_header + sizeof(header_t), data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:1057:4: [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_copy, b_work->data, size); data/ocamlnet-4.1.8/src/netsys/netsys_c_multicast.c:159: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(&mreq.imr_multiaddr, data/ocamlnet-4.1.8/src/netsys/netsys_c_multicast.c:162: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(&mreq.imr_interface, data/ocamlnet-4.1.8/src/netsys/netsys_c_multicast.c:178: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(&mreq.ipv6mr_multiaddr, data/ocamlnet-4.1.8/src/netsys/netsys_c_multicast.c:228: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(&mreq.imr_multiaddr, data/ocamlnet-4.1.8/src/netsys/netsys_c_multicast.c:231: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(&mreq.imr_interface, data/ocamlnet-4.1.8/src/netsys/netsys_c_multicast.c:247: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(&mreq.ipv6mr_multiaddr, data/ocamlnet-4.1.8/src/netsys/netsys_c_queue.c:62:6: [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(q1.table, data/ocamlnet-4.1.8/src/netsys/netsys_c_queue.c:69:6: [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(q1.table, data/ocamlnet-4.1.8/src/netsys/netsys_c_queue.c:72:6: [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(q1.table + n1, data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c:20: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[256]; data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c:23: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 b_function[64]; data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c:125: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(&spawn_mask, &save_mask, sizeof(sigset_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c:222: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). ttyfd = open(ttyname, O_RDWR); data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c:562: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). code = open(".", O_RDONLY, 0); data/ocamlnet-4.1.8/src/netsys/netsys_c_subprocess.c:154: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[sizeof(pid_t)]; data/ocamlnet-4.1.8/src/netsys/netsys_c_subprocess.c:168:2: [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(&pid, buf, sizeof(pid_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_subprocess.c:181: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[sizeof(pid_t)]; data/ocamlnet-4.1.8/src/netsys/netsys_c_subprocess.c:186: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(buf, &pid, sizeof(pid_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_subprocess.c:552: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(©, atom, sizeof(struct sigchld_atom)); data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:67:5: [2] (buffer) TCHAR: 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. TCHAR buffer[4096]; data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:86:5: [2] (buffer) TCHAR: 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. TCHAR buffer[4096]; data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:576: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 pipe_rd_buf[PIPE_HELPER_BUF_SIZE]; data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:579: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 pipe_wr_buf[PIPE_HELPER_BUF_SIZE]; data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:1324:5: [2] (buffer) CopyMemory: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. CopyMemory(String_val(s) + Int_val(pos), ph->pipe_rd_buf, l); data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:1392:5: [2] (buffer) CopyMemory: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. CopyMemory(ph->pipe_wr_buf, String_val(s) + Int_val(pos), l); data/ocamlnet-4.1.8/src/netsys/netsys_c_xdr.c:93:2: [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(String_val(uv), s+p, e); data/ocamlnet-4.1.8/src/nettls-gnutls/gnutls.c:102: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(String_val(s), d.data, d.size); data/ocamlnet-4.1.8/src/nettls-gnutls/gnutls.c:115: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(d.data, String_val(v), d.size); data/ocamlnet-4.1.8/src/nettls-gnutls/gnutls.c:397: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(r.data, String_val(datav), r.size); data/ocamlnet-4.1.8/src/rpc-auth-local/rpclocal.c:134: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[CMSG_SPACE(sizeof(*sc))]; data/ocamlnet-4.1.8/src/rpc-auth-local/rpclocal.c:136: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 iovbuf[1]; data/ocamlnet-4.1.8/src/rpc-xti/rpcxti.c:36: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 error[100]; data/ocamlnet-4.1.8/src/rpc-xti/rpcxti.c:53: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 abuf[ABUFLEN]; data/ocamlnet-4.1.8/src/netsys/netsys_c_event.c:415:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). code = read(ne->fd1, buf, 1); data/ocamlnet-4.1.8/src/netsys/netsys_c_event.c:421:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). code = read(ne->fd1, (char *) &n, 8); data/ocamlnet-4.1.8/src/netsys/netsys_c_locale.c: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). oldcopy_locale = stat_alloc(strlen(old_locale) + 1); data/ocamlnet-4.1.8/src/netsys/netsys_c_mem.c:400:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(Int_val(fdv), data, (int) numbytes); data/ocamlnet-4.1.8/src/netsys/netsys_c_poll.c:469:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(pa->cancel_fd, (char *) &buf, 8); data/ocamlnet-4.1.8/src/netsys/netsys_c_spawn.c:396:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(ctrl_pipe[0], me.buffer, sizeof(me.buffer)); data/ocamlnet-4.1.8/src/netsys/netsys_c_subprocess.c:158:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n=read(sigchld_pipe_rd, buf, sizeof(pid_t)); data/ocamlnet-4.1.8/src/netsys/netsys_c_syslog.c:91:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ident_buf, data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:1750:15: [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). pathlen = strlen(file) + 1; data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:2458:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fd_set read, write, except; data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:2480:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fdlist_to_fdset(readfds, &read); data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:2491:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (select(FD_SETSIZE, &read, &write, &except, tvp) == -1) data/ocamlnet-4.1.8/src/netsys/netsys_c_win32.c:2498:45: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_list = fdset_to_fdlist(readfds, &read); ANALYSIS SUMMARY: Hits = 87 Lines analyzed = 14365 in approximately 0.65 seconds (22223 lines/second) Physical Source Lines of Code (SLOC) = 11049 Hits@level = [0] 51 [1] 13 [2] 64 [3] 2 [4] 8 [5] 0 Hits@level+ = [0+] 138 [1+] 87 [2+] 74 [3+] 10 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 12.4898 [1+] 7.87402 [2+] 6.69744 [3+] 0.905059 [4+] 0.724047 [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.