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/socket++-1.12.13/acconfig.h Examining data/socket++-1.12.13/socket++/protocol.cpp Examining data/socket++-1.12.13/socket++/echo.cpp Examining data/socket++-1.12.13/socket++/sockunix.h Examining data/socket++-1.12.13/socket++/echo.h Examining data/socket++-1.12.13/socket++/protocol.h Examining data/socket++-1.12.13/socket++/sig.h Examining data/socket++-1.12.13/socket++/smtp.h Examining data/socket++-1.12.13/socket++/fork.cpp Examining data/socket++-1.12.13/socket++/fork.h Examining data/socket++-1.12.13/socket++/sockunix.cpp Examining data/socket++-1.12.13/socket++/pipestream.cpp Examining data/socket++-1.12.13/socket++/pipestream.h Examining data/socket++-1.12.13/socket++/sig.cpp Examining data/socket++-1.12.13/socket++/sockinet.h Examining data/socket++-1.12.13/socket++/smtp.cpp Examining data/socket++-1.12.13/socket++/sockinet.cpp Examining data/socket++-1.12.13/socket++/local.h Examining data/socket++-1.12.13/socket++/ftp.cpp Examining data/socket++-1.12.13/socket++/sockstream.h Examining data/socket++-1.12.13/socket++/ftp.h Examining data/socket++-1.12.13/socket++/sockstream.cpp Examining data/socket++-1.12.13/test/test_sockerr.C Examining data/socket++-1.12.13/test/tsig-0.C Examining data/socket++-1.12.13/test/tsockpair.C Examining data/socket++-1.12.13/test/tpopentest.C Examining data/socket++-1.12.13/test/thostnames.C Examining data/socket++-1.12.13/test/tcftp.C Examining data/socket++-1.12.13/test/tsendfiles.C Examining data/socket++-1.12.13/test/tcsmtp.C Examining data/socket++-1.12.13/test/simple_httpd.C Examining data/socket++-1.12.13/test/tdinwrite.C Examining data/socket++-1.12.13/test/tsunread.C Examining data/socket++-1.12.13/test/tsinwrite.C Examining data/socket++-1.12.13/test/tdunread.C Examining data/socket++-1.12.13/test/tfork0.C Examining data/socket++-1.12.13/test/tsinread.C Examining data/socket++-1.12.13/test/tnntp.C Examining data/socket++-1.12.13/test/tsecho.C Examining data/socket++-1.12.13/test/tpopen.C Examining data/socket++-1.12.13/test/tbind-1.C Examining data/socket++-1.12.13/test/twhois.C Examining data/socket++-1.12.13/test/tbind-0.C Examining data/socket++-1.12.13/test/tsmtp.C Examining data/socket++-1.12.13/test/testall.C Examining data/socket++-1.12.13/test/tfork.C Examining data/socket++-1.12.13/test/tpopen-ftp.C Examining data/socket++-1.12.13/test/tpopen-lpc.C Examining data/socket++-1.12.13/test/tdinread.C Examining data/socket++-1.12.13/test/tpipe.C Examining data/socket++-1.12.13/test/tsunwrite.C Examining data/socket++-1.12.13/test/tdunwrite.C Examining data/socket++-1.12.13/test/tcecho.C FINAL RESULTS: data/socket++-1.12.13/test/tdunread.C:37:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod (av[1], 0777) == -1) { data/socket++-1.12.13/test/tsunread.C:19:16: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. extern "C" int chmod (const char*, int); data/socket++-1.12.13/test/tsunread.C:34:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(av[1], 0777) == -1) { data/socket++-1.12.13/socket++/ftp.cpp:197: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 (addr, ina_p); data/socket++-1.12.13/socket++/ftp.h:122:16: [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. replycodea system () { return send_cmd ("SYST"); } data/socket++-1.12.13/socket++/sockunix.cpp:28:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). ::strcpy (sun_path, path); data/socket++-1.12.13/socket++/sockunix.cpp:34:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). ::strcpy (sun_path, suna.sun_path); data/socket++-1.12.13/test/tcftp.C:32:14: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. f->passwd (getpass ("passwd: ")); data/socket++-1.12.13/test/tcsmtp.C:36:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sender, "%s@%s", pw->pw_name, client->localhost()); data/socket++-1.12.13/test/testall.C:33:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "./tdinwrite %s %d mary had a little lamb", data/socket++-1.12.13/test/testall.C:52:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "./tsinwrite %s %d %%d%%s%%f 356 haha 23.5", data/socket++-1.12.13/test/testall.C:55:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "./tsinwrite %s %d %%s%%c oooiiii !", data/socket++-1.12.13/test/tpopentest.C:36:5: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system (buf); data/socket++-1.12.13/test/tsendfiles.C:37:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(rcpt, "RCPT TO:%s", av[1]); data/socket++-1.12.13/test/tsendfiles.C:40:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sender, "MAIL FROM:<%s@%s>", pw->pw_name, sio->localhost()); data/socket++-1.12.13/socket++/sockinet.cpp:316:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (TCP_NODELAY, &old, sizeof (old), proto->p_proto); data/socket++-1.12.13/socket++/sockinet.cpp:327:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (TCP_NODELAY, &old, sizeof (old), proto->p_proto); data/socket++-1.12.13/socket++/sockstream.cpp:713:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int sockbuf::getopt (int op, void* buf, int len, int level) const data/socket++-1.12.13/socket++/sockstream.cpp:730:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_type, &ty, sizeof (ty)); data/socket++-1.12.13/socket++/sockstream.cpp:737:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_error, &err, sizeof (err)); data/socket++-1.12.13/socket++/sockstream.cpp:744:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_debug, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:752:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_debug, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:760:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_reuseaddr, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:768:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_reuseaddr, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:776:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_keepalive, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:784:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_keepalive, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:792:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_dontroute, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:800:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_dontroute, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:808:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_broadcast, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:816:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_broadcast, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:824:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_oobinline, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:832:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_oobinline, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:847:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_linger, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:854:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_linger, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:862:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_sndbuf, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:869:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_sndbuf, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:877:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_rcvbuf, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.cpp:884:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (so_rcvbuf, &old, sizeof (old)); data/socket++-1.12.13/socket++/sockstream.h:250:9: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt(int op, void* buf, int len, data/socket++-1.12.13/test/tdinwrite.C:49:9: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. osin->getopt(sockbuf::so_sndtimeo, &timeo, sizeof(timeo)); data/socket++-1.12.13/test/tdinwrite.C:51:9: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. osin->getopt(sockbuf::so_rcvtimeo, &timeo, sizeof(timeo)); data/socket++-1.12.13/test/thostnames.C:55:6: [3] (random) setstate: 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. sio.setstate(ios::badbit); data/socket++-1.12.13/test/thostnames.C:72:6: [3] (random) setstate: 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. sio.setstate(ios::badbit); data/socket++-1.12.13/socket++/echo.cpp:43: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 [1024]; data/socket++-1.12.13/socket++/ftp.cpp:81:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf [1024]; data/socket++-1.12.13/socket++/ftp.cpp:90:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf [1024]; data/socket++-1.12.13/socket++/ftp.cpp:184:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostname [64]; data/socket++-1.12.13/socket++/ftp.cpp:188:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&sa.sin_addr, hp->h_addr, hp->h_length); data/socket++-1.12.13/socket++/ftp.cpp:194: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 [80]; data/socket++-1.12.13/socket++/ftp.cpp:204: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 (addr + strlen (addr), ",%d,%d", hi_portno, lo_portno); data/socket++-1.12.13/socket++/ftp.cpp:218: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 port [80]; data/socket++-1.12.13/socket++/ftp.cpp:220: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 (port, "%d,%d", hi_portno, lo_portno); data/socket++-1.12.13/socket++/ftp.cpp:295: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 b[32]; data/socket++-1.12.13/socket++/ftp.cpp:296: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 (b, "%d", numbytes); data/socket++-1.12.13/socket++/ftp.cpp:302: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 b[32]; data/socket++-1.12.13/socket++/ftp.cpp:303: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 (b, "%d", marker); data/socket++-1.12.13/socket++/ftp.h:72:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cwd [MAXPATHLEN]; data/socket++-1.12.13/socket++/ftp.h:73:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parentdir [MAXPATHLEN]; data/socket++-1.12.13/socket++/ftp.h:78:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char replycode [5]; data/socket++-1.12.13/socket++/local.h:78:9: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. pid_t vfork (); data/socket++-1.12.13/socket++/pipestream.cpp:43:17: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. pid_t pid = ::vfork (); data/socket++-1.12.13/socket++/smtp.cpp:127: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 buf [1024]; data/socket++-1.12.13/socket++/smtp.cpp:130:32: [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). if (filename == 0 || (fd = ::open (filename, O_RDONLY )) == -1) data/socket++-1.12.13/socket++/smtp.cpp:160: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 buf [1024]; data/socket++-1.12.13/socket++/sockinet.cpp:97:20: [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). sin_port = htons(atoi(sn)); data/socket++-1.12.13/socket++/sockinet.cpp:115:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&sin_addr, hp->h_addr, hp->h_length); data/socket++-1.12.13/socket++/sockinet.cpp:124: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. static char hostname[64]; data/socket++-1.12.13/socket++/sockstream.cpp:411:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (s, gptr (), n * sizeof (char_type)); data/socket++-1.12.13/socket++/sockstream.cpp:416: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 (s, gptr (), rval * sizeof (char_type)); data/socket++-1.12.13/socket++/sockstream.cpp:454:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (pptr (), s, n * sizeof (char_type)); data/socket++-1.12.13/socket++/sockstream.cpp:459: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 (pptr (), s, wval * sizeof (char_type)); data/socket++-1.12.13/test/simple_httpd.C:97:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file.open (filename.c_str()); data/socket++-1.12.13/test/tcecho.C:22:16: [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). int portno = atoi (av [2]); data/socket++-1.12.13/test/tcecho.C:34:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf [256]; data/socket++-1.12.13/test/tcsmtp.C:34: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 sender [256]; data/socket++-1.12.13/test/tdinread.C:23: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 buf[256]; data/socket++-1.12.13/test/tdinwrite.C:27:25: [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). osin->connect (av[1], atoi (av[2])); data/socket++-1.12.13/test/tdunread.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 buf[1024]; data/socket++-1.12.13/test/testall.C:19: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 buf[256]; data/socket++-1.12.13/test/testall.C:21: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 thostname[64]; data/socket++-1.12.13/test/thostnames.C:83: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 buf[1024]; data/socket++-1.12.13/test/tnntp.C:35:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/socket++-1.12.13/test/tnntp.C:46:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/socket++-1.12.13/test/tpipe.C:25: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 buf[32]; data/socket++-1.12.13/test/tpopen-ftp.C:16: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[128]; data/socket++-1.12.13/test/tpopen-lpc.C:16: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[128]; data/socket++-1.12.13/test/tpopen.C:18: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 buf[128]; data/socket++-1.12.13/test/tpopentest.C:23: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 buf[256]; data/socket++-1.12.13/test/tsecho.C:27:26: [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). server->serve_clients (atoi (av [1])); data/socket++-1.12.13/test/tsendfiles.C:28:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char rcpt[512]; data/socket++-1.12.13/test/tsendfiles.C:29:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sender[512]; data/socket++-1.12.13/test/tsendfiles.C:50:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/socket++-1.12.13/test/tsendfiles.C:67:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/socket++-1.12.13/test/tsinread.C:50: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 buf[256]; data/socket++-1.12.13/test/tsinread.C:75:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[256]; data/socket++-1.12.13/test/tsinwrite.C:30:27: [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). sio->connect(av [1], atoi (av [2])); data/socket++-1.12.13/test/tsinwrite.C:50:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/socket++-1.12.13/test/tsockpair.C:27:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/socket++-1.12.13/test/tsockpair.C:34:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/socket++-1.12.13/test/tsunread.C:42:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/socket++-1.12.13/test/tsunwrite.C:26:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/socket++-1.12.13/test/twhois.C:37:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/socket++-1.12.13/socket++/echo.cpp:46:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((rcnt = s.read (buf, 1024)) > 0) data/socket++-1.12.13/socket++/ftp.cpp:132:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (replycode, q, 3); data/socket++-1.12.13/socket++/ftp.cpp:147: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). xsputn (cmd, ::strlen (cmd)); data/socket++-1.12.13/socket++/ftp.cpp:150: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). xsputn (arg, ::strlen (arg)); data/socket++-1.12.13/socket++/ftp.cpp:204: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). sprintf (addr + strlen (addr), ",%d,%d", hi_portno, lo_portno); data/socket++-1.12.13/socket++/smtp.cpp:51: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). xsputn (cmd, ::strlen (cmd)); data/socket++-1.12.13/socket++/smtp.cpp:53: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). xsputn (s, ::strlen (s)); data/socket++-1.12.13/socket++/smtp.cpp:55: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). xsputn (p, ::strlen (p)); data/socket++-1.12.13/socket++/smtp.cpp:133:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((rcnt = ::read (fd, buf, 1024)) > 0) data/socket++-1.12.13/socket++/sockstream.cpp:388:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int rlen = read (eback (), (char*) rep->gend - (char*) eback ()); data/socket++-1.12.13/socket++/sockstream.cpp:504:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int sockbuf::read (void* buf, int len) data/socket++-1.12.13/socket++/sockstream.cpp:514:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((rval = ::read (rep->sock, (char*) buf, len)) == -1) data/socket++-1.12.13/socket++/sockstream.h:227:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read (void* buf, int len); ANALYSIS SUMMARY: Hits = 115 Lines analyzed = 5726 in approximately 0.13 seconds (42968 lines/second) Physical Source Lines of Code (SLOC) = 4002 Hits@level = [0] 12 [1] 13 [2] 59 [3] 28 [4] 12 [5] 3 Hits@level+ = [0+] 127 [1+] 115 [2+] 102 [3+] 43 [4+] 15 [5+] 3 Hits/KSLOC@level+ = [0+] 31.7341 [1+] 28.7356 [2+] 25.4873 [3+] 10.7446 [4+] 3.74813 [5+] 0.749625 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.