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/procserv-2.7.0/processFactory.cc Examining data/procserv-2.7.0/forkpty.c Examining data/procserv-2.7.0/libtelnet.h Examining data/procserv-2.7.0/processClass.h Examining data/procserv-2.7.0/connectionItem.cc Examining data/procserv-2.7.0/procServ.h Examining data/procserv-2.7.0/acceptFactory.cc Examining data/procserv-2.7.0/procServ.cc Examining data/procserv-2.7.0/clientFactory.cc Examining data/procserv-2.7.0/libtelnet.c FINAL RESULTS: data/procserv-2.7.0/acceptFactory.cc:331:12: [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(addr.sun_path, 0)<0) data/procserv-2.7.0/acceptFactory.cc:334:12: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if(chown(addr.sun_path, uid, gid)) data/procserv-2.7.0/acceptFactory.cc:337:12: [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(addr.sun_path, perms)<0) data/procserv-2.7.0/clientFactory.cc:105:9: [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(buf2, BUFLEN, "use %s%c to toggle auto restart" NL, CTL_SC(toggleRestartChar)); data/procserv-2.7.0/clientFactory.cc:107:9: [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(buf2, BUFLEN, "auto restart toggle disabled" NL); data/procserv-2.7.0/clientFactory.cc:112:9: [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(buf2, BUFLEN, "@@@ Use %s%c to logout from procServ server" NL, CTL_SC(logoutChar)); data/procserv-2.7.0/clientFactory.cc:124:5: [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(buf1, BUFLEN, "@@@ procServ server started at: %s" NL, data/procserv-2.7.0/clientFactory.cc:128:9: [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(buf2, BUFLEN, "@@@ Child \"%s\" started at: %s" NL, data/procserv-2.7.0/clientFactory.cc:133:5: [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(buf2, BUFLEN, "@@@ %d user(s) and %d logger(s) connected (plus you)" NL, data/procserv-2.7.0/clientFactory.cc:218:17: [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(msg, 128, "@@@ Toggled auto restart to %s" NL, data/procserv-2.7.0/forkpty.c:22:12: [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). if (c) strcpy(name, c); data/procserv-2.7.0/libtelnet.c:23:10: [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. # define vsnprintf _vsnprintf data/procserv-2.7.0/libtelnet.c:125:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer), fmt, va); data/procserv-2.7.0/libtelnet.c:1358:7: [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. rs = vsnprintf(buffer, sizeof(buffer), fmt, va); data/procserv-2.7.0/libtelnet.c:1366:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. rs = vsnprintf(output, rs + 1, fmt, va); data/procserv-2.7.0/libtelnet.c:1423:7: [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. rs = vsnprintf(buffer, sizeof(buffer), fmt, va); data/procserv-2.7.0/libtelnet.c:1431:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. rs = vsnprintf(output, rs + 1, fmt, va); data/procserv-2.7.0/libtelnet.h:55:55: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define TELNET_GNU_PRINTF(f,a) __attribute__((format(printf, f, a))) /*!< internal helper */ data/procserv-2.7.0/procServ.cc:195:5: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(PROCSERV_VERSION_STRING "\n"); data/procserv-2.7.0/procServ.cc:430:5: [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(infoMessage3, INFO3LEN,\ data/procserv-2.7.0/procServ.cc:455:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp, "[%s] ", timeFormat); data/procserv-2.7.0/procServ.cc:559:5: [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(infoMessage1, INFO1LEN, data/procserv-2.7.0/procServ.cc:567:9: [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(buff, BUFLEN, "@@@ Child \"%s\" started as: %s" NL, data/procserv-2.7.0/procServ.cc:570:9: [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(buff, BUFLEN, "@@@ Child started as: %s" NL, data/procserv-2.7.0/procServ.cc:573:5: [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(infoMessage2, INFO2LEN, "@@@ Child \"%s\" is SHUT DOWN" NL, childName); data/procserv-2.7.0/procServ.cc:607:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf( buf, "@@@ Got a sigPipe signal: Did the child close its tty?" NL); data/procserv-2.7.0/procServ.cc:753:9: [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(buf, "@@@ @@@ @@@ @@@ @@@" NL); data/procserv-2.7.0/procServ.h:30:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define PRINTF if (inDebugMode) printf data/procserv-2.7.0/processFactory.cc:66:5: [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(buf, BUFLEN, "@@@ Restarting child \"%s\"" NL, childName); data/procserv-2.7.0/processFactory.cc:70:13: [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(buf, BUFLEN, "@@@ (as %s)" NL, argv[0]); data/procserv-2.7.0/processFactory.cc:103:5: [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 (goodbye, BYELEN, "@@@ Child process is shutting down, %s" NL, data/procserv-2.7.0/processFactory.cc:108:5: [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(infoMessage2, INFO2LEN, "@@@ Child \"%s\" is SHUT DOWN" NL, childName); data/procserv-2.7.0/processFactory.cc:189:9: [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(infoMessage2, INFO2LEN, "@@@ Child \"%s\" PID: %ld" NL, childName, (long) _pid); data/procserv-2.7.0/processFactory.cc:191:9: [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(buf, BUFLEN, "@@@ The PID of new child \"%s\" is: %ld" NL, childName, (long) _pid); data/procserv-2.7.0/processFactory.cc:193:9: [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(buf, "@@@ @@@ @@@ @@@ @@@" NL); data/procserv-2.7.0/processFactory.cc:213: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. execvp(exe, argv); // execvp() data/procserv-2.7.0/procServ.cc:216:15: [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. pidFile = getenv( "PROCSERV_PID" ); data/procserv-2.7.0/procServ.cc:218:10: [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("PROCSERV_DEBUG") != NULL ) inDebugMode = true; data/procserv-2.7.0/procServ.cc:256:13: [3] (buffer) getopt_long: 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. c = getopt_long (argc, argv, "+c:de:fhi:I:k:l:L:n:p:P:qVwx:", data/procserv-2.7.0/acceptFactory.cc:45:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[40] = ""; data/procserv-2.7.0/acceptFactory.cc:140: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 myname[128] = "<unknown>\0"; data/procserv-2.7.0/acceptFactory.cc:273: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(addr.sun_path, spec.c_str(), spec.size()+1); data/procserv-2.7.0/clientFactory.cc:85: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 procServStart_buf[32]; // Time when this procServ started - as string data/procserv-2.7.0/clientFactory.cc:87: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 IOCStart_buf[32]; // Time when the current IOC was started - as string data/procserv-2.7.0/clientFactory.cc:89: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 buf1[BUFLEN], buf2[BUFLEN]; data/procserv-2.7.0/clientFactory.cc:92: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 greeting2[GREETLEN] = ""; data/procserv-2.7.0/clientFactory.cc:171: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[1600]; data/procserv-2.7.0/clientFactory.cc:215:17: [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 msg[128] = NL; data/procserv-2.7.0/forkpty.c:18:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ptm = open("/dev/ptmx", O_RDWR); /* open master */ data/procserv-2.7.0/forkpty.c:23:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). pts = open(name, O_RDWR); /* open slave */ data/procserv-2.7.0/libtelnet.c:120: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 buffer[512]; data/procserv-2.7.0/libtelnet.c:190: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 deflate_buffer[1024]; data/procserv-2.7.0/libtelnet.c:319:11: [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 bytes[3]; data/procserv-2.7.0/libtelnet.c:777: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(name, buffer + 1, size - 1); data/procserv-2.7.0/libtelnet.c:1109: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 inflate_buffer[1024]; data/procserv-2.7.0/libtelnet.c:1163:11: [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 bytes[2]; data/procserv-2.7.0/libtelnet.c:1176: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. unsigned char bytes[3]; data/procserv-2.7.0/libtelnet.c:1281:11: [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 sb[3]; data/procserv-2.7.0/libtelnet.c:1292:11: [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 bytes[5]; data/procserv-2.7.0/libtelnet.c:1353: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 buffer[1024]; data/procserv-2.7.0/libtelnet.c:1418: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 buffer[1024]; data/procserv-2.7.0/procServ.cc:84:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char infoMessage1[INFO1LEN]; // Sign on message: server PID, child pwd and command line data/procserv-2.7.0/procServ.cc:85:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char infoMessage2[INFO2LEN]; // Sign on message: child PID data/procserv-2.7.0/procServ.cc:86:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char infoMessage3[INFO3LEN]; // Sign on message: available server commands data/procserv-2.7.0/procServ.cc:124:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen( pidFile, "w" ); data/procserv-2.7.0/procServ.cc:207: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 buff[BUFLEN]; data/procserv-2.7.0/procServ.cc:272:17: [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). k = atoi( optarg ); data/procserv-2.7.0/procServ.cc:310:17: [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). k = atoi( optarg ); data/procserv-2.7.0/procServ.cc:339: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). i = abs( atoi( optarg ) ); data/procserv-2.7.0/procServ.cc:579: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/procserv-2.7.0/procServ.cc:678: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 stamp[64]; data/procserv-2.7.0/procServ.cc:742: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[BUFLEN] = NL; data/procserv-2.7.0/procServ.cc:857:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fh = open(buf, O_RDWR); data/procserv-2.7.0/procServ.cc:924: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). logFileFD = open(logFile, O_CREAT|O_WRONLY|O_APPEND, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); data/procserv-2.7.0/processClass.h:26:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char factoryName[100]; data/procserv-2.7.0/processFactory.cc:61: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[BUFLEN]; data/procserv-2.7.0/processFactory.cc:89: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 now_buf[NOWLEN] = "@@@ Current time: "; data/procserv-2.7.0/processFactory.cc:91: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 goodbye[BYELEN]; data/procserv-2.7.0/processFactory.cc:132: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[BUFLEN]; data/procserv-2.7.0/processFactory.cc:227: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[1600]; data/procserv-2.7.0/processFactory.cc:247: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 buf3[LINEBUF_LENGTH+1]; data/procserv-2.7.0/clientFactory.cc:109:5: [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(greeting2, buf1, GREETLEN-strlen(greeting2)-1); data/procserv-2.7.0/clientFactory.cc:109: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). strncat(greeting2, buf1, GREETLEN-strlen(greeting2)-1); data/procserv-2.7.0/clientFactory.cc:110:5: [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(greeting2, buf2, GREETLEN-strlen(greeting2)-1); data/procserv-2.7.0/clientFactory.cc:110: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). strncat(greeting2, buf2, GREETLEN-strlen(greeting2)-1); data/procserv-2.7.0/clientFactory.cc:113:9: [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(greeting2, buf2, GREETLEN-strlen(greeting2)-1); data/procserv-2.7.0/clientFactory.cc:113: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). strncat(greeting2, buf2, GREETLEN-strlen(greeting2)-1); data/procserv-2.7.0/clientFactory.cc:130:9: [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(buf1, buf2, BUFLEN-strlen(buf1)-1); data/procserv-2.7.0/clientFactory.cc:130: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). strncat(buf1, buf2, BUFLEN-strlen(buf1)-1); data/procserv-2.7.0/clientFactory.cc:143:46: [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). ignore_result( write(_fd, greeting1, strlen(greeting1)) ); data/procserv-2.7.0/clientFactory.cc:144:46: [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). ignore_result( write(_fd, greeting2, strlen(greeting2)) ); data/procserv-2.7.0/clientFactory.cc:147: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). ignore_result( write(_fd, infoMessage1, strlen(infoMessage1)) ); data/procserv-2.7.0/clientFactory.cc:148:46: [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). ignore_result( write( _fd, infoMessage2, strlen(infoMessage2)) ); data/procserv-2.7.0/clientFactory.cc:149: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). ignore_result( write( _fd, buf1, strlen(buf1)) ); data/procserv-2.7.0/clientFactory.cc:151: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). ignore_result( write(_fd, buf2, strlen(buf2)) ); data/procserv-2.7.0/clientFactory.cc:153:49: [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). ignore_result( write(_fd, infoMessage3, strlen(infoMessage3)) ); data/procserv-2.7.0/clientFactory.cc:174:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(_fd, buf, sizeof(buf)-1); data/procserv-2.7.0/clientFactory.cc:217: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). SendToAll(msg, strlen(msg), NULL); data/procserv-2.7.0/clientFactory.cc:220: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). SendToAll(msg, strlen(msg), NULL); data/procserv-2.7.0/libtelnet.c:722: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). c += strlen(c) + 1; data/procserv-2.7.0/libtelnet.c:734: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). c += strlen(c) + 1; data/procserv-2.7.0/libtelnet.c:1468: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). telnet_send(telnet, string, strlen(string)); data/procserv-2.7.0/libtelnet.c:1484: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). _send(telnet, ttype, strlen(ttype)); data/procserv-2.7.0/libtelnet.c:1535: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). telnet_send(telnet, arg, strlen(arg) + 1); data/procserv-2.7.0/procServ.cc:217: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 ( !pidFile || strlen(pidFile) == 0 ) pidFile = defaultpidFile; data/procserv-2.7.0/procServ.cc:315: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). ignChars = (char*) calloc( strlen(optarg) + 1 + ONE_CHAR_COMMANDS, 1); data/procserv-2.7.0/procServ.cc:317: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). while ( i <= strlen(optarg) ) { data/procserv-2.7.0/procServ.cc:422:9: [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 (ignChars, &killChar, 1); data/procserv-2.7.0/procServ.cc:424:9: [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 (ignChars, &toggleRestartChar, 1); data/procserv-2.7.0/procServ.cc:426:9: [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 (ignChars, &logoutChar, 1); data/procserv-2.7.0/procServ.cc:436:9: [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(infoMessage3, buff, INFO3LEN-strlen(infoMessage3)-1); data/procserv-2.7.0/procServ.cc:436:46: [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). strncat(infoMessage3, buff, INFO3LEN-strlen(infoMessage3)-1); data/procserv-2.7.0/procServ.cc:438:5: [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(infoMessage3, NL, INFO3LEN-strlen(infoMessage3)-1); data/procserv-2.7.0/procServ.cc:438: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). strncat(infoMessage3, NL, INFO3LEN-strlen(infoMessage3)-1); data/procserv-2.7.0/procServ.cc:454: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). char *tmp = (char*) calloc(strlen(timeFormat)+4, 1); data/procserv-2.7.0/procServ.cc:572:5: [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(infoMessage1, buff, INFO1LEN-strlen(infoMessage1)-1); data/procserv-2.7.0/procServ.cc:572:42: [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). strncat(infoMessage1, buff, INFO1LEN-strlen(infoMessage1)-1); data/procserv-2.7.0/procServ.cc:608:29: [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). SendToAll( buf, strlen(buf), NULL ); data/procserv-2.7.0/procServ.cc:686: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). len = strlen(stamp); data/procserv-2.7.0/procServ.cc:752: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). SendToAll(buf, strlen(buf), NULL); data/procserv-2.7.0/procServ.cc:754: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). SendToAll(buf, strlen(buf), NULL); data/procserv-2.7.0/procServ.cc:759: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). snprintf(buf+strlen(buf), BUFLEN-strlen(buf), data/procserv-2.7.0/procServ.cc:759:46: [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(buf+strlen(buf), BUFLEN-strlen(buf), data/procserv-2.7.0/procServ.cc:765: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). snprintf(buf+strlen(buf), BUFLEN-strlen(buf), data/procserv-2.7.0/procServ.cc:765:46: [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(buf+strlen(buf), BUFLEN-strlen(buf), data/procserv-2.7.0/procServ.cc:769:9: [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(buf, NL, BUFLEN-strlen(buf)-1); data/procserv-2.7.0/procServ.cc:769: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). strncat(buf, NL, BUFLEN-strlen(buf)-1); data/procserv-2.7.0/procServ.cc:770: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). SendToAll(buf, strlen(buf), NULL); data/procserv-2.7.0/processFactory.cc:67: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). SendToAll( buf, strlen(buf), 0 ); data/procserv-2.7.0/processFactory.cc:71:29: [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). SendToAll( buf, strlen(buf), 0 ); data/procserv-2.7.0/processFactory.cc:95: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). result = strftime( &now_buf[strlen(now_buf)], sizeof(now_buf) - strlen(now_buf) - 1, data/procserv-2.7.0/processFactory.cc:95:69: [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). result = strftime( &now_buf[strlen(now_buf)], sizeof(now_buf) - strlen(now_buf) - 1, data/procserv-2.7.0/processFactory.cc:97: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). if (result && (sizeof(now_buf) - strlen(now_buf) > 2)) { data/procserv-2.7.0/processFactory.cc:98:9: [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(now_buf, NL, NOWLEN-strlen(now_buf)-1); data/procserv-2.7.0/processFactory.cc:98: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). strncat(now_buf, NL, NOWLEN-strlen(now_buf)-1); data/procserv-2.7.0/processFactory.cc:100:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(now_buf, "@@@ Current time: N/A", NOWLEN); data/procserv-2.7.0/processFactory.cc:110:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SendToAll( now_buf, strlen(now_buf), this ); data/procserv-2.7.0/processFactory.cc:111: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). SendToAll( goodbye, strlen(goodbye), this ); data/procserv-2.7.0/processFactory.cc:112:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SendToAll( infoMessage3, strlen(infoMessage3), this ); data/procserv-2.7.0/processFactory.cc:192: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). SendToAll( buf, strlen(buf), this ); data/procserv-2.7.0/processFactory.cc:194: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). SendToAll( buf, strlen(buf), this ); data/procserv-2.7.0/processFactory.cc:229:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int len = read(_fd, buf, sizeof(buf)-1); data/procserv-2.7.0/processFactory.cc:261:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf2, buf, count); ANALYSIS SUMMARY: Hits = 143 Lines analyzed = 4418 in approximately 0.14 seconds (31490 lines/second) Physical Source Lines of Code (SLOC) = 3003 Hits@level = [0] 46 [1] 62 [2] 42 [3] 3 [4] 33 [5] 3 Hits@level+ = [0+] 189 [1+] 143 [2+] 81 [3+] 39 [4+] 36 [5+] 3 Hits/KSLOC@level+ = [0+] 62.9371 [1+] 47.619 [2+] 26.973 [3+] 12.987 [4+] 11.988 [5+] 0.999001 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.