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/socat-2.0.0~beta9/nestlex.c Examining data/socat-2.0.0~beta9/xio-streams.c Examining data/socat-2.0.0~beta9/xiolayer.h Examining data/socat-2.0.0~beta9/xiolayer.c Examining data/socat-2.0.0~beta9/xio-ip6.c Examining data/socat-2.0.0~beta9/xio-tcpwrap.c Examining data/socat-2.0.0~beta9/xio-gopen.c Examining data/socat-2.0.0~beta9/fdname.c Examining data/socat-2.0.0~beta9/xio-socks.c Examining data/socat-2.0.0~beta9/sysutils.h Examining data/socat-2.0.0~beta9/xio-termios.h Examining data/socat-2.0.0~beta9/error.h Examining data/socat-2.0.0~beta9/filan.c Examining data/socat-2.0.0~beta9/xioengine.c Examining data/socat-2.0.0~beta9/xio-progcall.c Examining data/socat-2.0.0~beta9/xio-creat.h Examining data/socat-2.0.0~beta9/xio-readline.c Examining data/socat-2.0.0~beta9/xio-ascii.h Examining data/socat-2.0.0~beta9/xio-stdio.c Examining data/socat-2.0.0~beta9/xio-named.h Examining data/socat-2.0.0~beta9/xio-socket.h Examining data/socat-2.0.0~beta9/xio-openssl.h Examining data/socat-2.0.0~beta9/xioopen.c Examining data/socat-2.0.0~beta9/xioopen.h Examining data/socat-2.0.0~beta9/xio-exec.h Examining data/socat-2.0.0~beta9/xiodiag.h Examining data/socat-2.0.0~beta9/xio-interface.c Examining data/socat-2.0.0~beta9/xio-socks.h Examining data/socat-2.0.0~beta9/xio-streams.h Examining data/socat-2.0.0~beta9/xio-nop.h Examining data/socat-2.0.0~beta9/xioconfig.h Examining data/socat-2.0.0~beta9/xio-ip4.c Examining data/socat-2.0.0~beta9/xio-ext2.h Examining data/socat-2.0.0~beta9/xiosignal.c Examining data/socat-2.0.0~beta9/xiosigchld.h Examining data/socat-2.0.0~beta9/xio-pipe.h Examining data/socat-2.0.0~beta9/hostan.h Examining data/socat-2.0.0~beta9/utils.h Examining data/socat-2.0.0~beta9/procan_main.c Examining data/socat-2.0.0~beta9/vsnprintf_r.h Examining data/socat-2.0.0~beta9/sycls.h Examining data/socat-2.0.0~beta9/procan.h Examining data/socat-2.0.0~beta9/xiomodes.h Examining data/socat-2.0.0~beta9/xio-pty.c Examining data/socat-2.0.0~beta9/xio-ascii.c Examining data/socat-2.0.0~beta9/xioread.c Examining data/socat-2.0.0~beta9/snprinterr.h Examining data/socat-2.0.0~beta9/xioopts.h Examining data/socat-2.0.0~beta9/snprinterr.c Examining data/socat-2.0.0~beta9/xio-pipe.c Examining data/socat-2.0.0~beta9/xio-pty.h Examining data/socat-2.0.0~beta9/xio-termios.c Examining data/socat-2.0.0~beta9/xio-interface.h Examining data/socat-2.0.0~beta9/socat.c Examining data/socat-2.0.0~beta9/xiosysincludes.h Examining data/socat-2.0.0~beta9/xio-sctp.c Examining data/socat-2.0.0~beta9/xio-test.c Examining data/socat-2.0.0~beta9/xio-tcp.c Examining data/socat-2.0.0~beta9/xiolockfile.c Examining data/socat-2.0.0~beta9/xio-test.h Examining data/socat-2.0.0~beta9/xio.h Examining data/socat-2.0.0~beta9/xioexit.c Examining data/socat-2.0.0~beta9/xiosocketpair.c Examining data/socat-2.0.0~beta9/xiotransfer.c Examining data/socat-2.0.0~beta9/sysincludes.h Examining data/socat-2.0.0~beta9/xio-creat.c Examining data/socat-2.0.0~beta9/xioclose.c Examining data/socat-2.0.0~beta9/xio-fdnum.h Examining data/socat-2.0.0~beta9/compat.h Examining data/socat-2.0.0~beta9/xioshutdown.c Examining data/socat-2.0.0~beta9/xio-socks5.c Examining data/socat-2.0.0~beta9/xio-udp.h Examining data/socat-2.0.0~beta9/xio-stdio.h Examining data/socat-2.0.0~beta9/error.c Examining data/socat-2.0.0~beta9/xio-openssl.c Examining data/socat-2.0.0~beta9/xiodiag.c Examining data/socat-2.0.0~beta9/xio-ip.c Examining data/socat-2.0.0~beta9/xio-socks5.h Examining data/socat-2.0.0~beta9/xio-fdnum.c Examining data/socat-2.0.0~beta9/xio-file.c Examining data/socat-2.0.0~beta9/xio-system.h Examining data/socat-2.0.0~beta9/xio-ip4.h Examining data/socat-2.0.0~beta9/dalan.h Examining data/socat-2.0.0~beta9/xio-proxy.c Examining data/socat-2.0.0~beta9/xio-readline.h Examining data/socat-2.0.0~beta9/xio-gopen.h Examining data/socat-2.0.0~beta9/xio-ext2.c Examining data/socat-2.0.0~beta9/mytypes.h Examining data/socat-2.0.0~beta9/xio-ipapp.c Examining data/socat-2.0.0~beta9/xio-process.c Examining data/socat-2.0.0~beta9/xio-proxy.h Examining data/socat-2.0.0~beta9/xiohelp.h Examining data/socat-2.0.0~beta9/procan.c Examining data/socat-2.0.0~beta9/xio-rawip.h Examining data/socat-2.0.0~beta9/filan.h Examining data/socat-2.0.0~beta9/xio-system.c Examining data/socat-2.0.0~beta9/vsnprintf_r.c Examining data/socat-2.0.0~beta9/xio-unix.h Examining data/socat-2.0.0~beta9/hostan.c Examining data/socat-2.0.0~beta9/sycls.c Examining data/socat-2.0.0~beta9/xioopts.c Examining data/socat-2.0.0~beta9/xio-ipapp.h Examining data/socat-2.0.0~beta9/Config/config.MacOSX-10-5.h Examining data/socat-2.0.0~beta9/Config/config.NetBSD-5-1.h Examining data/socat-2.0.0~beta9/Config/config.SunOS-5-10.h Examining data/socat-2.0.0~beta9/Config/config.FreeBSD-6-1.h Examining data/socat-2.0.0~beta9/Config/config.OpenBSD-4-3.h Examining data/socat-2.0.0~beta9/Config/config.Linux-2-6-24.h Examining data/socat-2.0.0~beta9/Config/config.Cygwin-1-5-25.h Examining data/socat-2.0.0~beta9/Config/config.AIX-5-3.h Examining data/socat-2.0.0~beta9/xio-ip.h Examining data/socat-2.0.0~beta9/xio-tcp.h Examining data/socat-2.0.0~beta9/xiohelp.c Examining data/socat-2.0.0~beta9/xioinitialize.c Examining data/socat-2.0.0~beta9/xioparam.c Examining data/socat-2.0.0~beta9/xio-file.h Examining data/socat-2.0.0~beta9/xio-tun.c Examining data/socat-2.0.0~beta9/xiostatic.h Examining data/socat-2.0.0~beta9/xio-nop.c Examining data/socat-2.0.0~beta9/xio-rawip.c Examining data/socat-2.0.0~beta9/xio-named.c Examining data/socat-2.0.0~beta9/xio-process.h Examining data/socat-2.0.0~beta9/xiowrite.c Examining data/socat-2.0.0~beta9/procan-cdefs.c Examining data/socat-2.0.0~beta9/xiolockfile.h Examining data/socat-2.0.0~beta9/xio-listen.c Examining data/socat-2.0.0~beta9/utils.c Examining data/socat-2.0.0~beta9/xio-udp.c Examining data/socat-2.0.0~beta9/xio-fd.c Examining data/socat-2.0.0~beta9/filan_main.c Examining data/socat-2.0.0~beta9/dalan.c Examining data/socat-2.0.0~beta9/xio-ip6.h Examining data/socat-2.0.0~beta9/xiosigchld.c Examining data/socat-2.0.0~beta9/sslcls.h Examining data/socat-2.0.0~beta9/sysutils.c Examining data/socat-2.0.0~beta9/xio-progcall.h Examining data/socat-2.0.0~beta9/xio-unix.c Examining data/socat-2.0.0~beta9/xio-sctp.h Examining data/socat-2.0.0~beta9/xio-tun.h Examining data/socat-2.0.0~beta9/nestlex.h Examining data/socat-2.0.0~beta9/xio-socket.c Examining data/socat-2.0.0~beta9/xio-fd.h Examining data/socat-2.0.0~beta9/xio-tcpwrap.h Examining data/socat-2.0.0~beta9/xio-exec.c Examining data/socat-2.0.0~beta9/xio-listen.h Examining data/socat-2.0.0~beta9/sslcls.c FINAL RESULTS: data/socat-2.0.0~beta9/sycls.c:696: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. retval = readlink(path, buf, bufsiz); data/socat-2.0.0~beta9/sycls.c:706:13: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. retval = chown(path, owner, group); data/socat-2.0.0~beta9/sycls.c:716:13: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. retval = chmod(path, mode); data/socat-2.0.0~beta9/sycls.h:221:25: [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. #define Readlink(p,b,s) readlink(p,b,s) data/socat-2.0.0~beta9/sycls.h:222:22: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. #define Chown(p,o,g) chown(p,o,g) data/socat-2.0.0~beta9/sycls.h:223:20: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. #define Chmod(p,m) chmod(p,m) data/socat-2.0.0~beta9/sysutils.c:706:23: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. envname[0] = '\0'; strncat(envname, progname, XIO_ENVNAMELEN-1); data/socat-2.0.0~beta9/sysutils.c:724:23: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. envname[0] = '\0'; strncat(envname, progname, XIO_ENVNAMELEN-1); data/socat-2.0.0~beta9/sysutils.c:748:23: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. envname[0] = '\0'; strncat(envname, progname, XIO_ENVNAMELEN-1); data/socat-2.0.0~beta9/xio-openssl.c:1317:25: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. envprefix[0] = '\0'; strncat(envprefix, progname, XIO_ENVNAMELEN-1); data/socat-2.0.0~beta9/xio-pty.c:148:22: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. ptyname[0] = '\0'; strncat(ptyname, tn, MAXPTYNAMELEN-1); data/socat-2.0.0~beta9/xioopen.c:1075:21: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. addr0[0] = '\0'; strncat(addr0, *addr, sizeof(addr0)-1); data/socat-2.0.0~beta9/xiosocketpair.c:64:22: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. ptyname[0] = '\0'; strncat(ptyname, tn, MAXPTYNAMELEN-1); data/socat-2.0.0~beta9/error.c:32:8: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. int syslog; data/socat-2.0.0~beta9/error.c:194:30: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. case 'y': return diagopts.syslog; data/socat-2.0.0~beta9/error.c:296:12: [4] (format) snprintf: 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. bytes = snprintf(buff, 11, F_time, epoch); data/socat-2.0.0~beta9/error.c:314:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. bytes = sprintf(bufp, "%s ", diagopts.hostname), bufp+=bytes; data/socat-2.0.0~beta9/error.c:316:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. bytes = sprintf(bufp, "%s["F_pid".%lu] ", data/socat-2.0.0~beta9/error.c:339:17: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (diagopts.syslog) { data/socat-2.0.0~beta9/fdname.c:50:3: [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(outfile, numform, fd); data/socat-2.0.0~beta9/filan.c:161:5: [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 (outfile, "; FIONREAD="F_Zu, sizet); data/socat-2.0.0~beta9/filan.c:265:7: [4] (format) snprintf: 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. snprintf(stdevstr, 8, F_dev, buf->st_dev); data/socat-2.0.0~beta9/filan.c:269:4: [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(outfile, "%4d: %s\t%s\t" data/socat-2.0.0~beta9/filan.c:980: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(outfile, "\t"F_time, time); data/socat-2.0.0~beta9/hostan.c:84:7: [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(ifr.ifr_name, ifp->ifr_name); data/socat-2.0.0~beta9/sycls.c:379:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, "%s(, {"F_dev","F_st_ino","F_mode","F_st_nlink","F_uid","F_gid, data/socat-2.0.0~beta9/sycls.c:383:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_dev, buf->st_rdev); data/socat-2.0.0~beta9/sycls.c:385:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_st_size, buf->st_size); data/socat-2.0.0~beta9/sycls.c:387:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_st_blksize, buf->st_blksize); data/socat-2.0.0~beta9/sycls.c:390:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_st_blocks, buf->st_blocks); data/socat-2.0.0~beta9/sycls.c:401:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(t, "%s(, {}) -> %d", func, result); data/socat-2.0.0~beta9/sycls.c:403:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, "%s(, {"F_dev","F_st64_ino","F_mode","F_st_nlink","F_uid","F_gid, data/socat-2.0.0~beta9/sycls.c:407:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_dev, buf->st_rdev); data/socat-2.0.0~beta9/sycls.c:409:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_st64_size, buf->st_size); data/socat-2.0.0~beta9/sycls.c:411:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_st_blksize, buf->st_blksize); data/socat-2.0.0~beta9/sycls.c:414:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. t += sprintf(t, ","F_st64_blocks, buf->st_blocks); data/socat-2.0.0~beta9/sycls.c:927:13: [4] (shell) execvp: 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. result = execvp(file, argv); data/socat-2.0.0~beta9/sycls.c:938:13: [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. result = system(string); data/socat-2.0.0~beta9/sycls.h:235:21: [4] (shell) execvp: 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. #define Execvp(f,a) execvp(f,a) data/socat-2.0.0~beta9/sycls.h:236:19: [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. #define System(s) system(s) data/socat-2.0.0~beta9/utils.c:81:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(env, "%s=%s", name, value); data/socat-2.0.0~beta9/utils.c:174:13: [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. result = vsnprintf(str, size, format, ap); data/socat-2.0.0~beta9/xio-exec.c:133:3: [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(tmp+1, pargv[0]); data/socat-2.0.0~beta9/xio-exec.c:135:3: [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(tmp, pargv[0]); data/socat-2.0.0~beta9/xio-ip.c:189:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(numnode, "::ffff:%s", node); data/socat-2.0.0~beta9/xio-ip.c:580:7: [4] (format) snprintf: 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. snprintf(valbuff, vallen, cmsgfmt, *(unsigned char *)CMSG_DATA(cmsg)); data/socat-2.0.0~beta9/xio-proxy.c:397:7: [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(header, authhead); data/socat-2.0.0~beta9/xio-socket.c:2002:4: [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(val, ifr.ifr_name); data/socat-2.0.0~beta9/xio-socket.c:2127:4: [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(namebuff, lr); data/socat-2.0.0~beta9/xio-socket.c:2152:7: [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(namebuff, lr); data/socat-2.0.0~beta9/xio-tcpwrap.c:63:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(xfd->para.socket.ip.hosts_allow_table, "%s/hosts.allow", data/socat-2.0.0~beta9/xio-tcpwrap.c:69:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(xfd->para.socket.ip.hosts_deny_table, "%s/hosts.deny", data/socat-2.0.0~beta9/xiolockfile.c:45:4: [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(s, lockfile); data/socat-2.0.0~beta9/xiolockfile.c:54:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. bytes = sprintf(pidbuf, F_pid, pid); data/socat-2.0.0~beta9/xiotransfer.c:44:7: [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(timestamp, ctime(&nowt)); data/socat-2.0.0~beta9/xiotransfer.c:55:7: [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(timestamp, ctime(&now)); data/socat-2.0.0~beta9/xiotransfer.c:78:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buff, "%s%s length="F_Zu" from=%lu to=%lu\n", data/socat-2.0.0~beta9/xiotransfer.c:82:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buff, "%s%s length="F_Zu" from=%lu to=%lu\n", data/socat-2.0.0~beta9/error.c:181:32: [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. if ((diagopts.hostname = getenv("HOSTNAME")) == NULL) { data/socat-2.0.0~beta9/socat.c:73:25: [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. if (mainwaitstring = getenv("SOCAT_MAIN_WAIT")) { data/socat-2.0.0~beta9/sycls.c:323:13: [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. result = chroot(path); data/socat-2.0.0~beta9/sycls.h:193:19: [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. #define Chroot(p) chroot(p) data/socat-2.0.0~beta9/sysutils.c:672:36: [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. if (overwrite >= 2 && (oldval = getenv(envname)) != NULL) { data/socat-2.0.0~beta9/utils.c:76:11: [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. if (getenv(name)) return 0; /* already exists */ data/socat-2.0.0~beta9/xio-openssl.c:1027:7: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom(tv.tv_sec*1000000+tv.tv_usec); data/socat-2.0.0~beta9/xio-openssl.c:1030:14: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. randdata = random(); data/socat-2.0.0~beta9/xio-socket.c:814:3: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom(tb.time*1000+tb.millitm); data/socat-2.0.0~beta9/xio-socket.c:823:3: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom(tv.tv_sec*1000000+tv.tv_usec); data/socat-2.0.0~beta9/xio-socket.c:826:16: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. dv = div(random(), IPPORT_RESERVED-XIO_IPPORT_LOWER); data/socat-2.0.0~beta9/xio-socks.c:279:21: [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. if ((userid = getenv("LOGNAME")) == NULL) { data/socat-2.0.0~beta9/xio-socks.c:280:17: [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. if ((userid = getenv("USER")) == NULL) { data/socat-2.0.0~beta9/xioinitialize.c:90:20: [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. default_ip = getenv("SOCAT_DEFAULT_LISTEN_IP"); data/socat-2.0.0~beta9/xioinitialize.c:101:22: [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. preferred_ip = getenv("SOCAT_PREFERRED_RESOLVE_IP"); data/socat-2.0.0~beta9/xioinitialize.c:267:28: [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. if (forkwaitstring = getenv("SOCAT_FORK_WAIT")) { data/socat-2.0.0~beta9/xioinitialize.c:281:25: [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. if (forkwaitstring = getenv("SOCAT_FORK_WAIT")) { data/socat-2.0.0~beta9/xiosocketpair.c:156:34: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. ssin.sin_port = htons(1024+random()%(65536-1024)); data/socat-2.0.0~beta9/xiosocketpair.c:184:30: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. ssin.sin_port = htons(1024+random()%(65536-1024)); data/socat-2.0.0~beta9/dalan.c:31: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 a[2]; data/socat-2.0.0~beta9/error.c:156:31: [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 ((diagopts.logfile = fopen(arg, "a")) == NULL) { data/socat-2.0.0~beta9/error.c:282: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 buff[BUFLEN], *bufp, *syslp; data/socat-2.0.0~beta9/error.c:306:16: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. bytes += sprintf(buff+19, ".%06lu ", micros); data/socat-2.0.0~beta9/error.c:352: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 exitmsg[20]; data/socat-2.0.0~beta9/error.c:374:6: [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 text[TEXTLEN]; data/socat-2.0.0~beta9/error.c:439:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (readfds) { memcpy(&save_readfds, readfds, sizeof(*readfds)); } data/socat-2.0.0~beta9/error.c:440:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (writefds) { memcpy(&save_writefds, writefds, sizeof(*writefds)); } data/socat-2.0.0~beta9/error.c:441:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (exceptfds) { memcpy(&save_exceptfds, exceptfds, sizeof(*exceptfds)); } data/socat-2.0.0~beta9/error.c:452:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (readfds) { memcpy(readfds, &save_readfds, sizeof(*readfds)); } data/socat-2.0.0~beta9/error.c:453:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (writefds) { memcpy(writefds, &save_writefds, sizeof(*writefds)); } data/socat-2.0.0~beta9/error.c:454:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (exceptfds) { memcpy(exceptfds, &save_exceptfds, sizeof(*exceptfds)); } data/socat-2.0.0~beta9/error.h:228: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 text[TEXTLEN]; data/socat-2.0.0~beta9/fdname.c:65: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 procpath[PATH_MAX]; data/socat-2.0.0~beta9/fdname.c:105: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 filepath[PATH_MAX]; data/socat-2.0.0~beta9/fdname.c:200: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 namebuff[FDNAME_NAMELEN]; data/socat-2.0.0~beta9/fdname.c:201: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 peerbuff[FDNAME_NAMELEN]; data/socat-2.0.0~beta9/filan.c:167: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. char _peername[SOCKADDR_MAX]; data/socat-2.0.0~beta9/filan.c:170: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. char peekbuff[1]; /* [0] fails with some compilers */ data/socat-2.0.0~beta9/filan.c:174: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. char ctrlbuff[5120]; data/socat-2.0.0~beta9/filan.c:217: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 stdevstr[8]; data/socat-2.0.0~beta9/filan.c:505: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. unsigned char s[4]; data/socat-2.0.0~beta9/filan.c:536: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 nambuff[FILAN_NAMELEN]; data/socat-2.0.0~beta9/filan.c:603:7: [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 c[FILAN_OPTLEN]; data/socat-2.0.0~beta9/filan.c:897:7: [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 c[FILAN_OPTLEN]; data/socat-2.0.0~beta9/filan.c:898:7: [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 i[FILAN_OPTLEN/sizeof(int)]; data/socat-2.0.0~beta9/filan.c:919:7: [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 outbuf[FILAN_OPTLEN*9+128], *cp = outbuf; data/socat-2.0.0~beta9/filan.c:922:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. cp += sprintf(cp, "%08x ", (unsigned int)optval.i[i]); data/socat-2.0.0~beta9/filan_main.c:145:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fdout = fopen(outfname, "w")) == NULL) { data/socat-2.0.0~beta9/hostan.c:58:13: [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. unsigned char buff[IFBUFSIZ]; data/socat-2.0.0~beta9/nestlex.c:106:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *endnest[2]; data/socat-2.0.0~beta9/nestlex.c:153:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *endnest[2]; data/socat-2.0.0~beta9/nestlex.c:197:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *endnest[2]; data/socat-2.0.0~beta9/procan.c:42: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 procpath[PATH_MAX], devpath[PATH_MAX+1]; data/socat-2.0.0~beta9/procan.c:44:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(procpath, "/proc/"F_pid"/fd/%d", Getpid(), 0 /*! fd*/); data/socat-2.0.0~beta9/snprinterr.c:55: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. char buf[BUFLEN] = ""; data/socat-2.0.0~beta9/socat.c:67: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 buff[10]; data/socat-2.0.0~beta9/socat.c:74:14: [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). sleep(atoi(mainwaitstring)); data/socat-2.0.0~beta9/socat.c:234:28: [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). xioparams->pipetype = atoi(&arg1[0][2]); break; data/socat-2.0.0~beta9/sycls.c:41:13: [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). result = open(pathname, flags, mode); data/socat-2.0.0~beta9/sycls.c:377: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 txt[256], *t = txt; data/socat-2.0.0~beta9/sycls.c:392:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(t, ",...}) -> %d", result); data/socat-2.0.0~beta9/sycls.c:398: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 txt[256], *t = txt; data/socat-2.0.0~beta9/sycls.c:416:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(t, ",...}) -> %d", result); data/socat-2.0.0~beta9/sycls.c:971: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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:986: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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:994:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[0], ((unsigned char *)serv_addr)[1], data/socat-2.0.0~beta9/sycls.c:994:50: [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. ((unsigned char *)serv_addr)[0], ((unsigned char *)serv_addr)[1], data/socat-2.0.0~beta9/sycls.c:995:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[2], ((unsigned char *)serv_addr)[3], data/socat-2.0.0~beta9/sycls.c:995:50: [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. ((unsigned char *)serv_addr)[2], ((unsigned char *)serv_addr)[3], data/socat-2.0.0~beta9/sycls.c:996:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[4], ((unsigned char *)serv_addr)[5], data/socat-2.0.0~beta9/sycls.c:996:50: [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. ((unsigned char *)serv_addr)[4], ((unsigned char *)serv_addr)[5], data/socat-2.0.0~beta9/sycls.c:997:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[6], ((unsigned char *)serv_addr)[7], data/socat-2.0.0~beta9/sycls.c:997:50: [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. ((unsigned char *)serv_addr)[6], ((unsigned char *)serv_addr)[7], data/socat-2.0.0~beta9/sycls.c:998:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[8], ((unsigned char *)serv_addr)[9], data/socat-2.0.0~beta9/sycls.c:998:50: [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. ((unsigned char *)serv_addr)[8], ((unsigned char *)serv_addr)[9], data/socat-2.0.0~beta9/sycls.c:999:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[10], ((unsigned char *)serv_addr)[11], data/socat-2.0.0~beta9/sycls.c:999:50: [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. ((unsigned char *)serv_addr)[10], ((unsigned char *)serv_addr)[11], data/socat-2.0.0~beta9/sycls.c:1000:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[12], ((unsigned char *)serv_addr)[13], data/socat-2.0.0~beta9/sycls.c:1000:50: [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. ((unsigned char *)serv_addr)[12], ((unsigned char *)serv_addr)[13], data/socat-2.0.0~beta9/sycls.c:1001:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)serv_addr)[14], ((unsigned char *)serv_addr)[15], data/socat-2.0.0~beta9/sycls.c:1001:50: [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. ((unsigned char *)serv_addr)[14], ((unsigned char *)serv_addr)[15], data/socat-2.0.0~beta9/sycls.c:1046:7: [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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:1063: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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:1081: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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:1146: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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:1170: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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:1217: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 infobuff[256]; data/socat-2.0.0~beta9/sycls.c:1317:7: [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 sockbuff[256]; data/socat-2.0.0~beta9/sycls.c:1385: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 chars[5*NCCS], *cp = chars; data/socat-2.0.0~beta9/sycls.c:1392:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. cp += sprintf(cp, "%02x,", termios_p->c_cc[i]); data/socat-2.0.0~beta9/sycls.c:1394:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(cp, "%02x", termios_p->c_cc[i]); data/socat-2.0.0~beta9/sycls.c:1407: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 chars[5*NCCS], *cp = chars; data/socat-2.0.0~beta9/sycls.c:1410:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. cp += sprintf(cp, "%02x,", termios_p->c_cc[i]); data/socat-2.0.0~beta9/sycls.c:1412:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(cp, "%02x", termios_p->c_cc[i]); data/socat-2.0.0~beta9/sycls.c:1575:13: [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). result = mkstemp(template); data/socat-2.0.0~beta9/sycls.h:168:21: [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). #define Open(p,f,m) open(p,f,m) data/socat-2.0.0~beta9/sycls.h:280:20: [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). #define Mkstemp(t) mkstemp(t) data/socat-2.0.0~beta9/sysutils.c:245: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 ubuff[5*UNIX_PATH_MAX+3]; data/socat-2.0.0~beta9/sysutils.c:309:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)binaddr)[0], data/socat-2.0.0~beta9/sysutils.c:310:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)binaddr)[1], data/socat-2.0.0~beta9/sysutils.c:311:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)binaddr)[2], data/socat-2.0.0~beta9/sysutils.c:312:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)binaddr)[3])) data/socat-2.0.0~beta9/sysutils.c:702: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 envname[XIO_ENVNAMELEN]; data/socat-2.0.0~beta9/sysutils.c:720: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 envname[XIO_ENVNAMELEN]; data/socat-2.0.0~beta9/sysutils.c:744: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 envname[XIO_ENVNAMELEN]; data/socat-2.0.0~beta9/sysutils.c:771: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 envbuff[XIO_LONGLEN]; data/socat-2.0.0~beta9/sysutils.c:781: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 envbuff[XIO_SHORTLEN]; data/socat-2.0.0~beta9/utils.c:37: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(dest, src, n); data/socat-2.0.0~beta9/vsnprintf_r.c:387: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 field[num_buff_len]; /* result of number conversion */ data/socat-2.0.0~beta9/xio-ascii.c:103:16: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. coded += sprintf(coded, "%02x", *data++); data/socat-2.0.0~beta9/xio-ascii.c:138:14: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. codbuff += sprintf(codbuff, "%02x", *data++); data/socat-2.0.0~beta9/xio-gopen.c:57:7: [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 infobuff[256]; data/socat-2.0.0~beta9/xio-ip.c:288: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(&sau->ip4, record->ai_addr, *socklen); data/socat-2.0.0~beta9/xio-ip.c:300: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(&sau->ip6, record->ai_addr, *socklen); data/socat-2.0.0~beta9/xio-ip.c:353: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(&sau->ip4.sin_addr, host->h_addr_list[0], 4); data/socat-2.0.0~beta9/xio-ip.c:360: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(&sau->ip6.sin6_addr, host->h_addr_list[0], 16); data/socat-2.0.0~beta9/xio-ip.c:406: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(&sau->ip4.sin_addr, host->h_addr_list[0], 4); data/socat-2.0.0~beta9/xio-ip.c:413: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(&sau->ip6.sin6_addr, host->h_addr_list[0], 16); data/socat-2.0.0~beta9/xio-ip.c:469: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 scratch1[16]; /* can hold an IPv4 address in ASCII */ data/socat-2.0.0~beta9/xio-ip.c:471: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 scratch2[16]; data/socat-2.0.0~beta9/xio-ip.c:472: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 scratch3[16]; data/socat-2.0.0~beta9/xio-ip4.c:81: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 addrbuf[256], maskbuf[256]; data/socat-2.0.0~beta9/xio-ip4.c:82: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 peername[256]; data/socat-2.0.0~beta9/xio-ip4.c:122:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(namebuff, "ADDR"); data/socat-2.0.0~beta9/xio-ip4.c:135:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(namebuff, "PORT"); data/socat-2.0.0~beta9/xio-ip6.c:176: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 peername[256]; data/socat-2.0.0~beta9/xio-ip6.c:228: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 scratch1[42]; /* can hold an IPv6 address in ASCII */ data/socat-2.0.0~beta9/xio-ip6.c:229: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 scratch2[32]; data/socat-2.0.0~beta9/xio-ip6.c:395:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(namebuff, "ADDR"); data/socat-2.0.0~beta9/xio-ip6.c:424:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(namebuff, "PORT"); data/socat-2.0.0~beta9/xio-ipapp.c:169: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 infobuff[256]; data/socat-2.0.0~beta9/xio-listen.c:114: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 infobuff[256]; data/socat-2.0.0~beta9/xio-listen.c:115: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 lisname[256]; data/socat-2.0.0~beta9/xio-listen.c:228:7: [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 peername[256]; data/socat-2.0.0~beta9/xio-listen.c:229:7: [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 sockname[256]; data/socat-2.0.0~beta9/xio-openssl.c:701: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 error_string[120]; data/socat-2.0.0~beta9/xio-openssl.c:1233: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 buf[120]; /* this value demanded by "man ERR_error_string" */ data/socat-2.0.0~beta9/xio-openssl.c:1311: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 envprefix[XIO_ENVNAMELEN]; data/socat-2.0.0~beta9/xio-openssl.c:1312: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 envname[XIO_ENVNAMELEN]; data/socat-2.0.0~beta9/xio-openssl.c:1424: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(str, buf, len); data/socat-2.0.0~beta9/xio-openssl.c:1634: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 error_string[120]; data/socat-2.0.0~beta9/xio-openssl.c:1695: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 error_string[120]; data/socat-2.0.0~beta9/xio-openssl.c:1756: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 error_string[120]; data/socat-2.0.0~beta9/xio-progcall.c:105: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 ptyname[MAXPTYNAMELEN]; data/socat-2.0.0~beta9/xio-proxy.c:351: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 request[CONNLEN]; /* HTTP connection request line */ data/socat-2.0.0~beta9/xio-proxy.c:353: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 buff[BUFLEN+1]; /* for receiving HTTP reply headers */ data/socat-2.0.0~beta9/xio-proxy.c:357: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 textbuff[2*BUFLEN+1]; /* just for sanitizing print data */ data/socat-2.0.0~beta9/xio-pty.c:60: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 ptyname[MAXPTYNAMELEN]; data/socat-2.0.0~beta9/xio-readline.c:50: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 msgbuf[256], *cp = msgbuf; data/socat-2.0.0~beta9/xio-readline.c:65:4: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(cp, "using "); cp = strchr(cp, '\0'); data/socat-2.0.0~beta9/xio-readline.c:67:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(cp, "readline on stdin for reading"); cp = strchr(cp, '\0'); data/socat-2.0.0~beta9/xio-readline.c:70:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(cp, " and "); cp = strchr(cp, '\0'); data/socat-2.0.0~beta9/xio-readline.c:73:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(cp, "stdio for writing"); cp = strchr(cp, '\0'); data/socat-2.0.0~beta9/xio-readline.c:115:7: [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 errbuf[128]; data/socat-2.0.0~beta9/xio-readline.c:213: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. ((char *)buff)[0] = '\0'; strncat(buff, line, bufsiz-1); data/socat-2.0.0~beta9/xio-readline.c:254: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(pipe->para.readline.dynend, ptr, len); data/socat-2.0.0~beta9/xio-socket.c:758: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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:909:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char dummy[1]; data/socat-2.0.0~beta9/xio-socket.c:940: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(&xfd->peersa.soa, them, xfd->salen); data/socat-2.0.0~beta9/xio-socket.c:983: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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:1085: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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:1249: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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:1250: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 lisname[256]; data/socat-2.0.0~beta9/xio-socket.c:1391:7: [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 peername[256]; data/socat-2.0.0~beta9/xio-socket.c:1397:7: [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 ctrlbuff[1024]; /* ancillary messages */ data/socat-2.0.0~beta9/xio-socket.c:1403: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 *dummy[2]; data/socat-2.0.0~beta9/xio-socket.c:1454: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 buff[512]; data/socat-2.0.0~beta9/xio-socket.c:1545: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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:1648: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 peekbuff[1]; data/socat-2.0.0~beta9/xio-socket.c:1687:7: [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 typbuff[16], *typp; data/socat-2.0.0~beta9/xio-socket.c:1688:7: [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 nambuff[128], *namp; data/socat-2.0.0~beta9/xio-socket.c:1689:7: [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 valbuff[256], *valp; data/socat-2.0.0~beta9/xio-socket.c:1690:7: [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 envbuff[256], *envp; data/socat-2.0.0~beta9/xio-socket.c:1797: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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:1804: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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:1868:7: [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 infobuff[256]; data/socat-2.0.0~beta9/xio-socket.c:2123: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 namebuff[XIOSOCKADDRENVLEN]; data/socat-2.0.0~beta9/xio-socket.c:2124: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 valuebuff[XIOSOCKADDRENVLEN]; data/socat-2.0.0~beta9/xio-socks.c:76:13: [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. unsigned char buff[BUFF_LEN]; data/socat-2.0.0~beta9/xio-socks.c:269:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(*socksport, "%u", ntohs(se->s_port)); data/socat-2.0.0~beta9/xio-socks.c:314: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(&sockhead->dest, &sau.ip4.sin_addr, 4); data/socat-2.0.0~beta9/xio-socks.c:329: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. ((char *)sockhead)[BUFF_LEN-1] = 0; data/socat-2.0.0~beta9/xio-socks.c:349:13: [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. unsigned char buff[SIZEOF_STRUCT_SOCKS4]; data/socat-2.0.0~beta9/xio-socks.c:422: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 msgbuff[3*SIZEOF_STRUCT_SOCKS4]; data/socat-2.0.0~beta9/xio-socks.h:15: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 userid[1]; /* just to have access via this struct */ data/socat-2.0.0~beta9/xio-socks5.c:212:13: [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. unsigned char sendbuff[SOCKS5_MAXLEN]; size_t sendlen; data/socat-2.0.0~beta9/xio-socks5.c:213:13: [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. unsigned char recvbuff[SOCKS5_MAXLEN]; data/socat-2.0.0~beta9/xio-socks5.c:412:13: [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. unsigned char sendbuff[513]; data/socat-2.0.0~beta9/xio-socks5.c:416:13: [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. unsigned char recvbuff[2]; data/socat-2.0.0~beta9/xio-tcpwrap.c:87: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 clientaddr[INET6_ADDRSTRLEN] = "", serveraddr[INET6_ADDRSTRLEN] = ""; data/socat-2.0.0~beta9/xio-tcpwrap.c:89: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 clientaddr[INET_ADDRSTRLEN] = "", serveraddr[INET_ADDRSTRLEN] = ""; data/socat-2.0.0~beta9/xio-test.c:141:6: [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 *)buff)[bytes] = '<'; data/socat-2.0.0~beta9/xio-test.c:154: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(buff1, buff, bytes); data/socat-2.0.0~beta9/xio-test.c:155:6: [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 *)buff1)[bytes] = '>'; data/socat-2.0.0~beta9/xio-test.c:195: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(buff1, buff, bytes); data/socat-2.0.0~beta9/xio-test.c:196:6: [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 *)buff1)[bytes] = '<'; data/socat-2.0.0~beta9/xio-udp.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 infobuff[256]; data/socat-2.0.0~beta9/xio-udp.c:110:13: [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. unsigned char buff1[1]; data/socat-2.0.0~beta9/xio-udp.c:193:7: [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 infobuff[256]; data/socat-2.0.0~beta9/xio-udp.c:254: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 buff[512]; data/socat-2.0.0~beta9/xio-unix.c:641:4: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(namebuff, "ADDR"); data/socat-2.0.0~beta9/xio.h:335:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *argv[MAXARGV]; /* address keyword, required args */ data/socat-2.0.0~beta9/xio.h:563:7: [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 ifindex[IF_NAMESIZE+1]; data/socat-2.0.0~beta9/xioinitialize.c:268: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). forkwaitsecs = atoi(forkwaitstring); data/socat-2.0.0~beta9/xioinitialize.c:282:22: [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). forkwaitsecs = atoi(forkwaitstring); data/socat-2.0.0~beta9/xiolockfile.c:27: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 pidbuf[3*sizeof(pid_t)+1]; data/socat-2.0.0~beta9/xiolockfile.c:46:4: [2] (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 string. strcat(s, ".XXXXXX"); data/socat-2.0.0~beta9/xioopen.c:691:6: [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 addr[MAXADDR]; data/socat-2.0.0~beta9/xioopen.c:716:6: [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 addr[MAXADDR]; data/socat-2.0.0~beta9/xioopen.c:747: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 addr[MAXADDR]; data/socat-2.0.0~beta9/xioopen.c:1035: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 addr0[20]; data/socat-2.0.0~beta9/xioopen.c:1040:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *ends[4+1]; data/socat-2.0.0~beta9/xioopen.c:1056: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 token[512], *tokp; data/socat-2.0.0~beta9/xioopts.c:1749: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 token[512], *tokp; size_t len; data/socat-2.0.0~beta9/xioopts.c:1752: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 optbuf[256]; size_t optlen; data/socat-2.0.0~beta9/xioopts.c:1753:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *endkey[6+1]; data/socat-2.0.0~beta9/xioopts.c:1754:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *endval[5+1]; data/socat-2.0.0~beta9/xioopts.c:2322:6: [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 buff[512], *buffp=buff; size_t bufspc = sizeof(buff)-1; data/socat-2.0.0~beta9/xioopts.c:2391:6: [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 buff[512], *buffp=buff; size_t bufspc = sizeof(buff)-1; data/socat-2.0.0~beta9/xioopts.c:2870: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 hostname[512], *hostp = hostname, *portp = NULL; data/socat-2.0.0~beta9/xioopts.c:3234: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(&data[oldlen], opt->value.u_bin.b_data, data/socat-2.0.0~beta9/xioopts.c:3997:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. *(int *)(&((char *)xfd)[opt->desc->major]) = opt->desc->arg3; data/socat-2.0.0~beta9/xioopts.c:3999: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(&((char *)xfd)[opt->desc->major], &opt->value, opt->desc->minor); data/socat-2.0.0~beta9/xioopts.c:3999:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. memcpy(&((char *)xfd)[opt->desc->major], &opt->value, opt->desc->minor); data/socat-2.0.0~beta9/xioread.c:150:7: [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 infobuff[256]; data/socat-2.0.0~beta9/xioread.c:151:7: [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 ctrlbuff[1024]; /* ancillary messages */ data/socat-2.0.0~beta9/xioread.c:168: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 infobuff[256]; data/socat-2.0.0~beta9/xioread.c:339:7: [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 infobuff[256]; data/socat-2.0.0~beta9/xioread.c:341:7: [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 ctrlbuff[1024]; /* ancillary messages */ data/socat-2.0.0~beta9/xioread.c:370: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 infobuff[256]; data/socat-2.0.0~beta9/xiosocketpair.c:24: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 ptyname[MAXPTYNAMELEN]; data/socat-2.0.0~beta9/xiotransfer.c:42:16: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. bytes += sprintf(timestamp+19, "."F_tv_usec" ", now.tv_usec); data/socat-2.0.0~beta9/xiotransfer.c:72: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 timestamp[MAXTIMESTAMPLEN]; data/socat-2.0.0~beta9/xiotransfer.c:73: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 buff[128+MAXTIMESTAMPLEN]; data/socat-2.0.0~beta9/xiowrite.c:90: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 infobuff[256]; data/socat-2.0.0~beta9/xiowrite.c:101: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 infobuff[256]; data/socat-2.0.0~beta9/xiowrite.c:110: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 infobuff[256]; data/socat-2.0.0~beta9/error.c:250:70: [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). send(diag_sock_send, &diag_dgram, sizeof(diag_dgram)-TEXTLEN + strlen(diag_dgram.text)+1, MSG_DONTWAIT data/socat-2.0.0~beta9/error.c:310: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). bytes = strlen(buff); data/socat-2.0.0~beta9/error.c:325:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bufp, text, BUFLEN-(bufp-buff)-1); data/socat-2.0.0~beta9/error.c:326: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(bufp, "\n"); data/socat-2.0.0~beta9/nestlex.c:89:27: [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(in, *endx, strlen(*endx))) { data/socat-2.0.0~beta9/nestlex.c:104:28: [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(in, *quotx, strlen(*quotx))) { data/socat-2.0.0~beta9/nestlex.c:109: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). in += strlen(*quotx); data/socat-2.0.0~beta9/nestlex.c:111: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). for (i = strlen(*quotx); i > 0; --i) { data/socat-2.0.0~beta9/nestlex.c:125: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). in += strlen(*quotx); data/socat-2.0.0~beta9/nestlex.c:130: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). for (i = strlen(*quotx); i > 0; --i) { data/socat-2.0.0~beta9/nestlex.c:149:28: [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(in, *quotx, strlen(*quotx))) { data/socat-2.0.0~beta9/nestlex.c:156: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). in += strlen(*quotx); data/socat-2.0.0~beta9/nestlex.c:158: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). for (i = strlen(*quotx); i > 0; --i) { data/socat-2.0.0~beta9/nestlex.c:172: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). in += strlen(*quotx); data/socat-2.0.0~beta9/nestlex.c:177: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). for (i = strlen(*quotx); i > 0; --i) { data/socat-2.0.0~beta9/nestlex.c:195:28: [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(in, *nestx, strlen(*nestx))) { data/socat-2.0.0~beta9/nestlex.c:201: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). for (i = strlen(nestx[1]); i > 0; --i) { data/socat-2.0.0~beta9/nestlex.c:211:13: [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). i = strlen(nestx[1]); while (i > 0) { data/socat-2.0.0~beta9/sycls.c:30:13: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). result = umask(mask); data/socat-2.0.0~beta9/sycls.c:523:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result = read(fd, buf, count); data/socat-2.0.0~beta9/sycls.c:1255:4: [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(usec); data/socat-2.0.0~beta9/sycls.h:167:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). #define Umask(m) umask(m) data/socat-2.0.0~beta9/sycls.h:206:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define Read(f,b,c) read(f,b,c) data/socat-2.0.0~beta9/sycls.h:254:19: [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 Usleep(u) usleep(u) data/socat-2.0.0~beta9/sysutils.c:197:7: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(cp+1, "\"", 1); data/socat-2.0.0~beta9/sysutils.c:258:57: [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). nextc = sanitize_string ("<anon>", MIN(UNIX_PATH_MAX, strlen("<anon>")), data/socat-2.0.0~beta9/sysutils.c:262: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). MIN(UNIX_PATH_MAX, strlen(sa->sun_path)), data/socat-2.0.0~beta9/sysutils.c:267:20: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. buff[0] = '\0'; strncat(buff, ubuff, blen-1); data/socat-2.0.0~beta9/sysutils.c:617:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ); /* ok */ data/socat-2.0.0~beta9/sysutils.c:673: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). size_t newlen = strlen(oldval)+strlen(sep)+strlen(value)+1; data/socat-2.0.0~beta9/sysutils.c:673:38: [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 newlen = strlen(oldval)+strlen(sep)+strlen(value)+1; data/socat-2.0.0~beta9/sysutils.c:673:50: [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 newlen = strlen(oldval)+strlen(sep)+strlen(value)+1; data/socat-2.0.0~beta9/sysutils.c:707: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). l = strlen(envname); data/socat-2.0.0~beta9/sysutils.c:709:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(envname+l, "_", XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:711:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(envname+l, varname, XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:725: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). l = strlen(progname); data/socat-2.0.0~beta9/sysutils.c:726:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(envname+l, "_", XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:728:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(envname+l, varname, XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:729: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). l += strlen(envname+l); data/socat-2.0.0~beta9/sysutils.c:730:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(envname+l, "_", XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:732:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(envname+l, varname2, XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:733: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). l += strlen(envname+l); data/socat-2.0.0~beta9/sysutils.c:749: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). l = strlen(progname); data/socat-2.0.0~beta9/sysutils.c:750:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(envname+l, "_", XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:752:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(envname+l, varname, XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:753: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). l += strlen(envname+l); data/socat-2.0.0~beta9/sysutils.c:754:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(envname+l, "_", XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:756:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(envname+l, varname2, XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:757: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). l += strlen(envname+l); data/socat-2.0.0~beta9/sysutils.c:758:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(envname+l, "_", XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:760:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(envname+l, varname3, XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/sysutils.c:761: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). l += strlen(envname+l); data/socat-2.0.0~beta9/utils.c:78:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((env = Malloc(strlen(name)+strlen(value)+2)) == NULL) { data/socat-2.0.0~beta9/utils.c:78: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 ((env = Malloc(strlen(name)+strlen(value)+2)) == NULL) { data/socat-2.0.0~beta9/vsnprintf_r.c:77: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). i = size - strlen(np); data/socat-2.0.0~beta9/vsnprintf_r.c:111: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). i = size - strlen(np); data/socat-2.0.0~beta9/vsnprintf_r.c:155: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). i = size - strlen(np); data/socat-2.0.0~beta9/vsnprintf_r.c:187: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). i = size - strlen(np); data/socat-2.0.0~beta9/vsnprintf_r.c:239: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). i = size - strlen(np); data/socat-2.0.0~beta9/vsnprintf_r.c:273: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). i = size - strlen(np); data/socat-2.0.0~beta9/vsnprintf_r.c:315: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). i = size - strlen(np); data/socat-2.0.0~beta9/vsnprintf_r.c:347: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). i = size - strlen(np); data/socat-2.0.0~beta9/xio-exec.c:101:13: [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(argv[1])+1; data/socat-2.0.0~beta9/xio-exec.c:128: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). if ((tmp = Malloc(strlen(pargv[0])+2)) == NULL) { data/socat-2.0.0~beta9/xio-ip.c:180: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). if ((numnode = Malloc(strlen(node)+7+1)) == NULL) { data/socat-2.0.0~beta9/xio-ip.c:195: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). } else if (node && node[0] == '[' && node[(nodelen=strlen(node))-1]==']') { data/socat-2.0.0~beta9/xio-ip.c:205:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(numnode, node+1, nodelen-2); /* ok */ data/socat-2.0.0~beta9/xio-ip.c:481:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IP", typlen-1); data/socat-2.0.0~beta9/xio-ip.c:490:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IP_PKTINFO", typlen-1); data/socat-2.0.0~beta9/xio-ip.c:514:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IP_RECVERR", typlen-1); data/socat-2.0.0~beta9/xio-ip.c:533:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IP_RECVIF", typlen-1); data/socat-2.0.0~beta9/xio-ip.c:534:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "if", namlen-1); data/socat-2.0.0~beta9/xio-ip.c:535:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. envbuff[0] = '\0'; strncat(envbuff, "IP_IF", envlen-1); data/socat-2.0.0~beta9/xio-ip.c:537:7: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(valbuff, data/socat-2.0.0~beta9/xio-ip.c:546:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IP_RECVDSTADDR", typlen-1); data/socat-2.0.0~beta9/xio-ip.c:547:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "dstaddr", namlen-1); data/socat-2.0.0~beta9/xio-ip.c:548:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. envbuff[0] = '\0'; strncat(envbuff, "IP_DSTADDR", envlen-1); data/socat-2.0.0~beta9/xio-ip.c:569: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(cmsgtype) >= typlen) rc = STAT_WARNING; data/socat-2.0.0~beta9/xio-ip.c:570:23: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. typbuff[0] = '\0'; strncat(typbuff, cmsgtype, typlen-1); data/socat-2.0.0~beta9/xio-ip.c:571: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(cmsgname) >= namlen) rc = STAT_WARNING; data/socat-2.0.0~beta9/xio-ip.c:572:23: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. nambuff[0] = '\0'; strncat(nambuff, cmsgname, namlen-1); data/socat-2.0.0~beta9/xio-ip.c:574: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). if (strlen(cmsgenvn) >= envlen) rc = STAT_WARNING; data/socat-2.0.0~beta9/xio-ip.c:575:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. envbuff[0] = '\0'; strncat(envbuff, cmsgenvn, envlen-1); data/socat-2.0.0~beta9/xio-ip6.c:90: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). if (rangename[0] != '[' || rangename[strlen(rangename)-1] != ']') { data/socat-2.0.0~beta9/xio-ip6.c:240:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_PKTINFO", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:251:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_HOPLIMIT", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:252:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "hoplimit", namlen-1); data/socat-2.0.0~beta9/xio-ip6.c:261:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_RTHDR", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:262:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "rthdr", namlen-1); data/socat-2.0.0~beta9/xio-ip6.c:268:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_AUTHHDR", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:269:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "authhdr", namlen-1); data/socat-2.0.0~beta9/xio-ip6.c:275:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_DSTOPTS", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:276:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "dstopts", namlen-1); data/socat-2.0.0~beta9/xio-ip6.c:282:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_HOPOPTS", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:283:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "hopopts", namlen-1); data/socat-2.0.0~beta9/xio-ip6.c:289:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_FLOWINFO", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:290:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "flowinfo", namlen-1); data/socat-2.0.0~beta9/xio-ip6.c:296:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. typbuff[0] = '\0'; strncat(typbuff, "IPV6_TCLASS", typlen-1); data/socat-2.0.0~beta9/xio-ip6.c:297:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "tclass", namlen-1); data/socat-2.0.0~beta9/xio-ip6.c:303:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "data", namlen-1); data/socat-2.0.0~beta9/xio-openssl.c:1318: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). l = strlen(envprefix); data/socat-2.0.0~beta9/xio-openssl.c:1320:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(envprefix+l, "_OPENSSL_", XIO_ENVNAMELEN-l-1); data/socat-2.0.0~beta9/xio-openssl.c:1325:39: [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(*entry, envprefix, strlen(envprefix))) { data/socat-2.0.0~beta9/xio-openssl.c:1327:34: [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 (eq == NULL) eq = *entry + strlen(*entry); data/socat-2.0.0~beta9/xio-openssl.c:1328:22: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. envname[0] = '\0'; strncat(envname, *entry, eq-*entry); data/socat-2.0.0~beta9/xio-proxy.c:371:27: [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). * xiosanitize(request, strlen(request), textbuff) = '\0'; data/socat-2.0.0~beta9/xio-proxy.c:374: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 (writefull(xfd->wfd, request, strlen(request)) < 0) { data/socat-2.0.0~beta9/xio-proxy.c:376: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). xfd->wfd, request, strlen(request), strerror(errno)); data/socat-2.0.0~beta9/xio-proxy.c:393: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). Malloc(XIOAUTHLEN+((strlen(proxyvars->authstring)+2)/3)*4+3)) data/socat-2.0.0~beta9/xio-proxy.c:399:10: [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). strlen(proxyvars->authstring), data/socat-2.0.0~beta9/xio-proxy.c:404:39: [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 (writefull(xfd->wfd, header, strlen(header)) < 0) { data/socat-2.0.0~beta9/xio-proxy.c:406:26: [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). xfd->wfd, header, strlen(header), strerror(errno)); data/socat-2.0.0~beta9/xio-proxy.c:547:27: [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). * xiosanitize(buff, Min(strlen(buff), (sizeof(textbuff)-1)>>1), data/socat-2.0.0~beta9/xio-readline.c:212: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). bytes = strlen(line); data/socat-2.0.0~beta9/xio-readline.c:213:33: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. ((char *)buff)[0] = '\0'; strncat(buff, line, bufsiz-1); data/socat-2.0.0~beta9/xio-readline.c:216:3: [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(buff, "\n"); ++bytes; data/socat-2.0.0~beta9/xio-socket.c:1745:34: [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). } else if (!strcasecmp(typp+strlen(typp)-strlen(namp), namp)) { data/socat-2.0.0~beta9/xio-socket.c:1745: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). } else if (!strcasecmp(typp+strlen(typp)-strlen(namp), namp)) { data/socat-2.0.0~beta9/xio-socket.c:1919:26: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. nambuff[0] = '\0'; strncat(nambuff, "data", namlen-1); data/socat-2.0.0~beta9/xio-socket.c:1939:58: [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). snprintf(strchr(valbuff, '\0')-1/*del \n*/, vallen-strlen(valbuff)+1, ", %06ld usecs", (long)tv->tv_usec); data/socat-2.0.0~beta9/xio-socket.c:1948: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(cmsgtype) >= typlen) rc = STAT_WARNING; data/socat-2.0.0~beta9/xio-socket.c:1949:23: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. typbuff[0] = '\0'; strncat(typbuff, cmsgtype, typlen-1); data/socat-2.0.0~beta9/xio-socket.c:1950: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(cmsgname) >= namlen) rc = STAT_WARNING; data/socat-2.0.0~beta9/xio-socket.c:1951:23: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. nambuff[0] = '\0'; strncat(nambuff, cmsgname, namlen-1); data/socat-2.0.0~beta9/xio-socket.c:1952: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(cmsgenvn) >= envlen) rc = STAT_WARNING; data/socat-2.0.0~beta9/xio-socket.c:1953:23: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. envbuff[0] = '\0'; strncat(envbuff, cmsgenvn, envlen-1); data/socat-2.0.0~beta9/xio-socket.c:2038:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addrname, rangename, maskname-rangename-1); /* ok */ data/socat-2.0.0~beta9/xio-socket.c:2132:73: [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). xiosetsockaddrenv_unix(idx, strchr(namebuff, '\0'), XIOSOCKADDRENVLEN-strlen(lr), data/socat-2.0.0~beta9/xio-socket.c:2142:75: [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). xiosetsockaddrenv_ip4(idx, strchr(namebuff, '\0'), XIOSOCKADDRENVLEN-strlen(lr), data/socat-2.0.0~beta9/xio-socket.c:2146: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). namebuff[strlen(lr)] = '\0'; ++idx; data/socat-2.0.0~beta9/xio-socket.c:2155:75: [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). xiosetsockaddrenv_ip6(idx, strchr(namebuff, '\0'), XIOSOCKADDRENVLEN-strlen(lr), data/socat-2.0.0~beta9/xio-socket.c:2159: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). namebuff[strlen(lr)] = '\0'; ++idx; data/socat-2.0.0~beta9/xio-socks.c:285:32: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. sockhead->userid[0] = '\0'; strncat(sockhead->userid, userid, *headlen-SIZEOF_STRUCT_SOCKS4-1); data/socat-2.0.0~beta9/xio-socks.c:286:36: [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). *headlen = SIZEOF_STRUCT_SOCKS4+strlen(userid)+1; data/socat-2.0.0~beta9/xio-socks.c:328:34: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. insert_position[0] = '\0'; strncat(insert_position, hostname, BUFF_LEN-*headlen-1); data/socat-2.0.0~beta9/xio-socks.c:330:19: [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). *headlen += strlen(hostname) + 1; data/socat-2.0.0~beta9/xio-socks5.c:294:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((namelen = strlen(targetname)) > 255) { data/socat-2.0.0~beta9/xio-socks5.c:298:34: [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). sendrequest->destaddr[0] = strlen(targetname); data/socat-2.0.0~beta9/xio-socks5.c:299:42: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. *(sendrequest->destaddr+1) = '\0'; strncat(sendrequest->destaddr+1, targetname, sizeof(sendbuff)-5); data/socat-2.0.0~beta9/xio-socks5.c:305: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). *((uint16_t *)&sendrequest->destaddr[strlen(targetname)+1]) = targetport; data/socat-2.0.0~beta9/xio-socks5.c:433:13: [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(username); data/socat-2.0.0~beta9/xio-socks5.c:434:17: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. *pos = '\0'; strncat(pos, username, 255); data/socat-2.0.0~beta9/xio-socks5.c:435: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). pos += strlen(username); data/socat-2.0.0~beta9/xio-socks5.c:436:13: [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(password); data/socat-2.0.0~beta9/xio-socks5.c:437:17: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. *pos = '\0'; strncat(pos, password, 255); data/socat-2.0.0~beta9/xio-socks5.c:438: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). pos += strlen(password); data/socat-2.0.0~beta9/xio-tcpwrap.c:62: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). Malloc(strlen(xfd->para.socket.ip.tcpwrap_etc)+1+11+1); data/socat-2.0.0~beta9/xio-tcpwrap.c:68: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). Malloc(strlen(xfd->para.socket.ip.tcpwrap_etc)+1+10+1); data/socat-2.0.0~beta9/xio-tun.c:115:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, tunname, IFNAMSIZ); /* ok */ data/socat-2.0.0~beta9/xio-unix.c:97:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((pathlen = strlen(path)) >= sizeof(saun->sun_path)) { data/socat-2.0.0~beta9/xio-unix.c:102:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(saun->sun_path+1, path, sizeof(saun->sun_path)-1); /* ok */ data/socat-2.0.0~beta9/xio-unix.c:116:19: [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 ((pathlen = strlen(path)) > sizeof(saun->sun_path)) { data/socat-2.0.0~beta9/xio-unix.c:120:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(saun->sun_path, path, sizeof(saun->sun_path)); /* ok */ data/socat-2.0.0~beta9/xiohelp.c:121:48: [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). fprintf(of, " %s", an->name); pos += strlen(an->name); data/socat-2.0.0~beta9/xiohelp.c:130: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). fputs(syntax, of); pos += strlen(syntax); } data/socat-2.0.0~beta9/xiohelp.c:158: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). pos += strlen(addressgroupnames[j]); data/socat-2.0.0~beta9/xiolockfile.c:41:20: [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 ((s = Malloc(strlen(lockfile)+8)) == NULL) { data/socat-2.0.0~beta9/xioopen.c:452:10: [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). strlen(xioparams->reversechar))); data/socat-2.0.0~beta9/xioopen.c:454: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). addrs += strlen(xioparams->reversechar); /* consume "reverse" */ data/socat-2.0.0~beta9/xioopen.c:465: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(addrs, xioparams->pipesep, strlen(xioparams->pipesep))) { data/socat-2.0.0~beta9/xioopen.c:471: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). addrs += strlen(xioparams->pipesep); /* consume "%" */ data/socat-2.0.0~beta9/xioopen.c:475:10: [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). strlen(xioparams->reversechar))); data/socat-2.0.0~beta9/xioopen.c:477: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). addrs += strlen(xioparams->reversechar); /* consume "reverse" */ data/socat-2.0.0~beta9/xioopen.c:494:6: [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). strlen(xioparams->chainsep))) { data/socat-2.0.0~beta9/xioopen.c:495: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). addrs += strlen(xioparams->chainsep); data/socat-2.0.0~beta9/xioopen.c:933:10: [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). strlen(xioparams->reversechar))); data/socat-2.0.0~beta9/xioopen.c:936: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). *addr += strlen(xioparams->reversechar); data/socat-2.0.0~beta9/xioopen.c:946: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 (strncmp(*addr, xioopts.pipesep, strlen(xioopts.pipesep))) { data/socat-2.0.0~beta9/xioopen.c:953:13: [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). *addr += strlen(xioparams->pipesep); data/socat-2.0.0~beta9/xioopen.c:1126:45: [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). while (!strncmp(*addr, xioopts.paramsep, strlen(xioopts.paramsep))) { data/socat-2.0.0~beta9/xioopen.c:1131: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). *addr += strlen(xioopts.paramsep); data/socat-2.0.0~beta9/xioopts.c:1800: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). while (!strncmp(*a, ",", strlen(","))) { (*a) += strlen(","); } data/socat-2.0.0~beta9/xioopts.c:1800:57: [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). while (!strncmp(*a, ",", strlen(","))) { (*a) += strlen(","); } data/socat-2.0.0~beta9/xioopts.c:1841:36: [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(*a, assign_str, strlen(assign_str))) { data/socat-2.0.0~beta9/xioopts.c:1843: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). (*a) += strlen(assign_str); data/socat-2.0.0~beta9/xioopts.c:2362:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((*opts)[i].value.u_ip_mreq.ifindex, tokp, IF_NAMESIZE); /* ok */ data/socat-2.0.0~beta9/xioopts.c:2834:6: [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). strlen(opt->value.u_string)); data/socat-2.0.0~beta9/xioopts.c:2917:36: [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(bindp, portsep, strlen(portsep))) { data/socat-2.0.0~beta9/xioopts.c:2922:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). portp = bindp + strlen(portsep); data/socat-2.0.0~beta9/xioopts.c:3145:10: [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). strlen(opt->value.u_string)+1) < 0) { data/socat-2.0.0~beta9/xioopts.c:3148:26: [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). opt->value.u_string, strlen(opt->value.u_string)+1, data/socat-2.0.0~beta9/xioopts.c:3272: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). strlen(opt->value3.u_string)+1) < 0) { data/socat-2.0.0~beta9/xioopts.c:3275: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). opt->value3.u_string, strlen(opt->value3.u_string)+1, data/socat-2.0.0~beta9/xioopts.c:3424:5: [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). strlen(pwd->pw_name)+1); data/socat-2.0.0~beta9/xioopts.c:3429:5: [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). strlen(pwd->pw_dir)+1); data/socat-2.0.0~beta9/xioopts.c:3434:5: [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). strlen(pwd->pw_shell)+1); data/socat-2.0.0~beta9/xioopts.c:3890:3: [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). strlen(opt->value.u_string)+1); data/socat-2.0.0~beta9/xioparam.c:45:43: [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). Error1("strdup("F_Zu"): out of memory", strlen(arg)+1); data/socat-2.0.0~beta9/xioparam.c:71:22: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. arg[0] = '\0'; strncat(arg, xioopts.pipesep, n-1); data/socat-2.0.0~beta9/xiotransfer.c:45: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). bytes = strlen(timestamp); data/socat-2.0.0~beta9/xiotransfer.c:56: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). bytes = strlen(timestamp); ANALYSIS SUMMARY: Hits = 486 Lines analyzed = 39899 in approximately 1.20 seconds (33202 lines/second) Physical Source Lines of Code (SLOC) = 30875 Hits@level = [0] 219 [1] 191 [2] 218 [3] 19 [4] 45 [5] 13 Hits@level+ = [0+] 705 [1+] 486 [2+] 295 [3+] 77 [4+] 58 [5+] 13 Hits/KSLOC@level+ = [0+] 22.834 [1+] 15.7409 [2+] 9.55466 [3+] 2.49393 [4+] 1.87854 [5+] 0.421053 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.