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/rdist-6.1.5/src/hasmntopt.c Examining data/rdist-6.1.5/src/strdup.c Examining data/rdist-6.1.5/src/strerror.c Examining data/rdist-6.1.5/src/vsprintf.c Examining data/rdist-6.1.5/src/rdist.c Examining data/rdist-6.1.5/src/client.c Examining data/rdist-6.1.5/src/child.c Examining data/rdist-6.1.5/src/docmd.c Examining data/rdist-6.1.5/src/distopt.c Examining data/rdist-6.1.5/src/expand.c Examining data/rdist-6.1.5/src/lookup.c Examining data/rdist-6.1.5/src/isexec.c Examining data/rdist-6.1.5/src/signal.c Examining data/rdist-6.1.5/src/common.c Examining data/rdist-6.1.5/src/setargs.c Examining data/rdist-6.1.5/src/rdistd.c Examining data/rdist-6.1.5/src/filesys-os.c Examining data/rdist-6.1.5/src/strcasecmp.c Examining data/rdist-6.1.5/src/strtol.c Examining data/rdist-6.1.5/src/regex.c Examining data/rdist-6.1.5/src/rshrcmd.c Examining data/rdist-6.1.5/src/filesys.c Examining data/rdist-6.1.5/src/server.c Examining data/rdist-6.1.5/src/message.c Examining data/rdist-6.1.5/config/config-data.h Examining data/rdist-6.1.5/config/config-def.h Examining data/rdist-6.1.5/config/config.h Examining data/rdist-6.1.5/config/os-TEMPLATE.h Examining data/rdist-6.1.5/config/os-aix3.h Examining data/rdist-6.1.5/config/os-aix4.h Examining data/rdist-6.1.5/config/os-bsdi.h Examining data/rdist-6.1.5/config/os-bsdi2.h Examining data/rdist-6.1.5/config/os-concen.h Examining data/rdist-6.1.5/config/os-cxux.h Examining data/rdist-6.1.5/config/os-dcosx.h Examining data/rdist-6.1.5/config/os-dgux.h Examining data/rdist-6.1.5/config/os-dynix.h Examining data/rdist-6.1.5/config/os-dynixptx.h Examining data/rdist-6.1.5/config/os-fpx4.h Examining data/rdist-6.1.5/config/os-freebsd2.h Examining data/rdist-6.1.5/config/os-ftx.h Examining data/rdist-6.1.5/config/os-hpux9.h Examining data/rdist-6.1.5/config/os-hpux10.h Examining data/rdist-6.1.5/config/os-irix4.h Examining data/rdist-6.1.5/config/os-irix5.h Examining data/rdist-6.1.5/config/os-irix6.h Examining data/rdist-6.1.5/config/os-isc.h Examining data/rdist-6.1.5/config/os-mipsos4.h Examining data/rdist-6.1.5/config/os-mipsos5.h Examining data/rdist-6.1.5/config/os-ncr.h Examining data/rdist-6.1.5/config/os-nextstep2.h Examining data/rdist-6.1.5/config/os-nextstep3.h Examining data/rdist-6.1.5/config/os-osf1.h Examining data/rdist-6.1.5/config/os-pyrosx.h Examining data/rdist-6.1.5/config/os-sppux.h Examining data/rdist-6.1.5/config/os-stellix.h Examining data/rdist-6.1.5/config/os-sunos4.h Examining data/rdist-6.1.5/config/os-sunos5.h Examining data/rdist-6.1.5/config/os-svr4.h Examining data/rdist-6.1.5/config/os-tracebsd.h Examining data/rdist-6.1.5/config/os-ultrix4.h Examining data/rdist-6.1.5/config/os-unicos.h Examining data/rdist-6.1.5/config/os-xinu43.h Examining data/rdist-6.1.5/config/os-linux.h Examining data/rdist-6.1.5/include/filesys.h Examining data/rdist-6.1.5/include/pathnames.h Examining data/rdist-6.1.5/include/rdistpaths.h Examining data/rdist-6.1.5/include/types.h Examining data/rdist-6.1.5/include/version.h Examining data/rdist-6.1.5/include/defs.h FINAL RESULTS: data/rdist-6.1.5/src/client.c:688:12: [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. sizerr = (readlink(target, lbuf, sizeof(lbuf)) != stb->st_size); data/rdist-6.1.5/src/server.c:110:13: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. status = chown(file, (CHOWN_UID_T) uid, data/rdist-6.1.5/src/server.c:125:13: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. status = chown(file, (CHOWN_UID_T) -1, data/rdist-6.1.5/src/server.c:157:12: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. status = chmod(file, mode); data/rdist-6.1.5/src/server.c:1018:10: [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(target, mode) != 0) data/rdist-6.1.5/src/server.c:1170:12: [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. if ((i = readlink(target, tbuf, sizeof(tbuf))) >= 0 && data/rdist-6.1.5/src/client.c:112:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buff, "%s/%s", dest, path); data/rdist-6.1.5/src/client.c:130:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buff, "%s/%s", dest, cp); data/rdist-6.1.5/src/client.c:132:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buff, "%s%s", dest, cp); data/rdist-6.1.5/src/client.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(lname, dest); data/rdist-6.1.5/src/client.c:376: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(lname, remfilename(lp->src, lp->target, data/rdist-6.1.5/src/client.c:530:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(ptarget, "%s%s", data/rdist-6.1.5/src/client.c:1188:10: [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). (void) strcpy(source, src); data/rdist-6.1.5/src/client.c:1203:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buff, "%s%s%s %s %s", data/rdist-6.1.5/src/client.c:1262:10: [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). (void) strcpy(destcopy, dest); data/rdist-6.1.5/src/common.c:335:10: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf((cmd == C_NONE) ? buf : buf + 1, fmt, args); data/rdist-6.1.5/src/common.c:361:10: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf((cmd == C_NONE) ? buf : buf + 1, fmt, args); data/rdist-6.1.5/src/common.c:382:10: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void) sprintf((cmd == C_NONE) ? buf : buf + 1, data/rdist-6.1.5/src/common.c:474:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(mbuf, data/rdist-6.1.5/src/common.c:561:10: [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). (void) strcpy(buf, pwd->pw_name); data/rdist-6.1.5/src/common.c:599:10: [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). (void) strcpy(buf, grp->gr_name); data/rdist-6.1.5/src/common.c:669:10: [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). (void) strcpy(ebuf, file); data/rdist-6.1.5/src/common.c:798:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buff, data/rdist-6.1.5/src/common.c:835:10: [4] (shell) execl: 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. (void) execl(_PATH_BSHELL, "sh", "-c", cmd, 0); data/rdist-6.1.5/src/distopt.c:124:11: [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). (void) strcpy(buf, distoptinfo[i].do_name); data/rdist-6.1.5/src/distopt.c:127:11: [4] (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). (void) strcat(buf, distoptinfo[i].do_name); data/rdist-6.1.5/src/distopt.c:149:11: [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). (void) strcpy(buf, distoptinfo[i].do_name); data/rdist-6.1.5/src/distopt.c:152:11: [4] (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). (void) strcat(buf, distoptinfo[i].do_name); data/rdist-6.1.5/src/docmd.c:106:13: [4] (shell) popen: 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. FILE *pf, *popen(); data/rdist-6.1.5/src/docmd.c:146:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buf, "IFS=\" \t\"; export IFS; %s -oi -t", data/rdist-6.1.5/src/docmd.c:148:7: [4] (shell) popen: 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. pf = popen(buf, "w"); data/rdist-6.1.5/src/docmd.c:696:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(name, R_OK) < 0 || stat(name, &stb) < 0) { data/rdist-6.1.5/src/docmd.c:717:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buf, "%s=%s;%s", data/rdist-6.1.5/src/docmd.c:725:12: [4] (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). (void) strcat(*env, name); data/rdist-6.1.5/src/docmd.c:769:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(env, "%s='", E_FILES); data/rdist-6.1.5/src/docmd.c:809:11: [4] (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). (void) strcat(env, sc->sc_name); data/rdist-6.1.5/src/expand.c:265:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf((char *)ebuf, data/rdist-6.1.5/src/expand.c:271:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf((char *)ebuf, "%s%s", s, tail); data/rdist-6.1.5/src/expand.c:404: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). (void) strcpy(pathp, dp->d_name); data/rdist-6.1.5/src/expand.c:416:9: [4] (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). (void) strcat(path, SYSERR); data/rdist-6.1.5/src/expand.c:483:11: [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). (void) strcpy((char *)lm, (char *)pl); data/rdist-6.1.5/src/expand.c:484:11: [4] (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). (void) strcat((char *)restbuf, (char *)pe + 1); data/rdist-6.1.5/src/filesys-os.c:192:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(remote_dev, "%s", mnt->f_mntfromname); data/rdist-6.1.5/src/filesys.c:104: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). (void) strcpy(last_pathname, pathname); data/rdist-6.1.5/src/filesys.c:107:17: [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). (void) strcpy(file, pathname); data/rdist-6.1.5/src/filesys.c:115:10: [4] (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). (void) strcat(file, pathname); data/rdist-6.1.5/src/message.c:135:12: [4] (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). (void) strcat(buf, msgtypes[x].mt_name); data/rdist-6.1.5/src/message.c:283: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). (void) strcpy(msgbuf, msgstr); data/rdist-6.1.5/src/message.c:476:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(tempfile, "%s/%s", cp, _RDIST_TMP); data/rdist-6.1.5/src/message.c:535:11: [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). (void) strcpy(mbuf, msgbuf); data/rdist-6.1.5/src/message.c:537:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(mbuf, "%s: %s", currenthost, msgbuf); data/rdist-6.1.5/src/message.c:600:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:616:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:635:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void) sprintf(buf, fmt, a1, a2, a3, a4, a5); data/rdist-6.1.5/src/message.c:669:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:685:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:703:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void) sprintf(buf, fmt, a1, a2, a3, a4, a5); data/rdist-6.1.5/src/message.c:722:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buf, "REMOTE ERROR: %s", msg); data/rdist-6.1.5/src/message.c:724:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buf, "LOCAL ERROR: %s", msg); data/rdist-6.1.5/src/message.c:745:10: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:764:10: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:783:10: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void) sprintf(buf, fmt, a1, a2, a3, a4, a5, a6); data/rdist-6.1.5/src/message.c:805:18: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buf, "REMOTE ERROR: %s", msg); data/rdist-6.1.5/src/message.c:807:18: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(buf, "LOCAL ERROR: %s", msg); data/rdist-6.1.5/src/message.c:827:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:844:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/message.c:861:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void) sprintf(buf, fmt, a1, a2, a3, a4, a5); data/rdist-6.1.5/src/rdist.c:137:10: [4] (shell) execl: 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. (void) execl(_PATH_OLDRDIST, xbasename(_PATH_OLDRDIST), data/rdist-6.1.5/src/rdist.c:324:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access("distfile", R_OK) == 0) data/rdist-6.1.5/src/rdist.c:326:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. else if (access("Distfile", R_OK) == 0) data/rdist-6.1.5/src/rdist.c:332:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(distfile, R_OK) != 0) data/rdist-6.1.5/src/rdist.c:457:10: [4] (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). (void) strcat(buf, nl->n_name); data/rdist-6.1.5/src/rshrcmd.c:95:4: [4] (shell) execlp: 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. execlp(_PATH_BSHELL, xbasename(_PATH_BSHELL), "-c", data/rdist-6.1.5/src/rshrcmd.c:99:4: [4] (shell) execlp: 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. execlp(path_remsh, xbasename(path_remsh), data/rdist-6.1.5/src/server.c:84:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(ptarget, "/%s", string); data/rdist-6.1.5/src/server.c:225: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(last_owner, owner); data/rdist-6.1.5/src/server.c:257: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(last_group, gr->gr_name); data/rdist-6.1.5/src/server.c:532:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(env, "export %s;%s=%s", data/rdist-6.1.5/src/server.c:540:12: [4] (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). (void) strcat(env, cp); data/rdist-6.1.5/src/server.c:552:12: [4] (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). (void) strcat(env, cp); data/rdist-6.1.5/src/server.c:714:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(savefile, "%s%s", file, SAVE_SUFFIX); data/rdist-6.1.5/src/server.c:1047:14: [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). (void) strcpy(lowner, cp); data/rdist-6.1.5/src/server.c:1056:14: [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). (void) strcpy(lgroup, cp); data/rdist-6.1.5/src/server.c:1067:13: [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). (void) strcpy(lowner, cp); data/rdist-6.1.5/src/server.c:1071:13: [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). (void) strcpy(lgroup, cp); data/rdist-6.1.5/src/server.c:1153:2: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). mktemp(new); data/rdist-6.1.5/src/server.c:1156:8: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). (mktemp(new), symlink(buf, new) < 0)) { data/rdist-6.1.5/src/server.c:1472:11: [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). (void) strcpy(new, tempname); data/rdist-6.1.5/src/server.c:1474:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(new, "/%s", tempname); data/rdist-6.1.5/src/server.c:1477:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void) sprintf(new, "%s/%s", target, tempname); data/rdist-6.1.5/src/server.c:1598: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). (void) strcpy(tempname, _RDIST_TMP); data/rdist-6.1.5/src/setargs.c:114: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). (void) strcpy(p, msg); data/rdist-6.1.5/src/setargs.c:134:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/setargs.c:150:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void) vsprintf(buf, fmt, args); data/rdist-6.1.5/src/setargs.c:166:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void) sprintf(buf, fmt, a1, a2, a3, a4, a5, a6); data/rdist-6.1.5/src/strdup.c:16:26: [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). extern char *strcpy(); data/rdist-6.1.5/src/strdup.c:21: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). (void) strcpy(p, str); data/rdist-6.1.5/src/vsprintf.c:7:1: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buf, fmt, args) data/rdist-6.1.5/src/message.c:466:9: [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. char *getenv(); data/rdist-6.1.5/src/message.c:472:13: [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 ((cp = getenv("TMPDIR")) == (char *) NULL) data/rdist-6.1.5/src/rdist.c:159: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. while ((c = getopt(argc, argv, optchars)) != -1) data/rdist-6.1.5/src/rdistd.c:72: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. while ((c = getopt(argc, argv, "SDV")) != -1) data/rdist-6.1.5/config/os-dynixptx.h:103:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-dynixptx.h:103:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-hpux10.h:110:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-hpux10.h:110:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-hpux9.h:110:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-hpux9.h:110:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-irix5.h:93:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-irix5.h:93:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-irix6.h:93:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-irix6.h:93:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-ncr.h:36:8: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #undef bcopy data/rdist-6.1.5/config/os-sppux.h:110:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-sppux.h:110:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-stellix.h:84:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-stellix.h:84:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-svr4.h:89:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-svr4.h:89:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-unicos.h:79:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/config/os-unicos.h:79:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/rdist-6.1.5/include/filesys.h:65:8: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #undef bcopy data/rdist-6.1.5/src/child.c:191: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 rbuf[BUFSIZ]; data/rdist-6.1.5/src/client.c:69: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 buf[BUFSIZ]; /* general purpose buffer */ data/rdist-6.1.5/src/client.c:71: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 target[BUFSIZ]; /* target/source directory name */ data/rdist-6.1.5/src/client.c:72: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 source[BUFSIZ]; /* source directory name */ data/rdist-6.1.5/src/client.c:88: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. static char buff[BUFSIZ]; data/rdist-6.1.5/src/client.c:364: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. static char buff[MAXPATHLEN]; data/rdist-6.1.5/src/client.c:407: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). if ((f = open(target, O_RDONLY)) < 0) { data/rdist-6.1.5/src/client.c:661: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. static char tbuf[BUFSIZ]; data/rdist-6.1.5/src/client.c:662: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 lbuf[MAXPATHLEN]; data/rdist-6.1.5/src/client.c:689: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. (void) sprintf(tbuf, "%.*s", (int) stb->st_size, lbuf); data/rdist-6.1.5/src/client.c:964: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). if (owner && atoi(owner) != statp->st_uid) { data/rdist-6.1.5/src/client.c:989: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). if (group && atoi(group) != statp->st_gid) { data/rdist-6.1.5/src/client.c:1175: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. static char destcopy[MAXPATHLEN]; data/rdist-6.1.5/src/client.c:1199: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. static char buff[BUFSIZ]; data/rdist-6.1.5/src/common.c:65: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 host[MAXHOSTNAMELEN]; /* Name of this host */ data/rdist-6.1.5/src/common.c:330: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. static char buf[BUFSIZ]; data/rdist-6.1.5/src/common.c:351: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. static char buf[BUFSIZ]; data/rdist-6.1.5/src/common.c:379: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. static char buf[BUFSIZ]; data/rdist-6.1.5/src/common.c:472: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 mbuf[BUFSIZ]; data/rdist-6.1.5/src/common.c:519:2: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((char *) remptr, p, space); data/rdist-6.1.5/src/common.c:535: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. static char buf[100]; data/rdist-6.1.5/src/common.c:544:10: [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. (void) sprintf(buf, ":%d", uid); data/rdist-6.1.5/src/common.c:559:10: [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. (void) sprintf(buf, ":%d", uid); data/rdist-6.1.5/src/common.c:574: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. static char buf[100]; data/rdist-6.1.5/src/common.c:583:10: [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. (void) sprintf(buf, ":%d", gid); data/rdist-6.1.5/src/common.c:597:10: [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. (void) sprintf(buf, ":%d", gid); data/rdist-6.1.5/src/common.c:796: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. static char buff[BUFSIZ]; data/rdist-6.1.5/src/common.c:816: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 sbuf[BUFSIZ], buf[BUFSIZ]; data/rdist-6.1.5/src/common.c:830:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). (void) open(_PATH_DEVNULL, O_RDONLY); data/rdist-6.1.5/src/distopt.c:120: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. static char buf[1024]; data/rdist-6.1.5/src/distopt.c:142: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. static char buf[1024]; data/rdist-6.1.5/src/docmd.c:108: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. static char buf[BUFSIZ]; data/rdist-6.1.5/src/docmd.c:128:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(file, O_RDONLY)) < 0) { data/rdist-6.1.5/src/docmd.c:317: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 tuser[BUFSIZ], buf[BUFSIZ]; data/rdist-6.1.5/src/docmd.c:356: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. (void) sprintf(buf, "%.*s -S", sizeof(buf)-5, path_rdistd); data/rdist-6.1.5/src/docmd.c:388:19: [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). proto_version = atoi(&respbuff[1]); data/rdist-6.1.5/src/docmd.c:712: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[BUFSIZ]; data/rdist-6.1.5/src/docmd.c:808:11: [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. (void) strcat(env, "';"); data/rdist-6.1.5/src/expand.c:73: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 *argvbuf[MAXEARGS]; data/rdist-6.1.5/src/expand.c:136:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pathbuf[BUFSIZ]; data/rdist-6.1.5/src/expand.c:296:6: [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((char *)ebuf, data/rdist-6.1.5/src/expand.c:415:9: [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. (void) strcat(path, ": "); data/rdist-6.1.5/src/filesys-os.c:175: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. static char remote_dev[MAXHOSTNAMELEN+MAXPATHLEN+1]; data/rdist-6.1.5/src/filesys-os.c:235:9: [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). return(fopen(file, mode)); data/rdist-6.1.5/src/filesys.c:72: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. static char last_pathname[MAXPATHLEN]; data/rdist-6.1.5/src/filesys.c:73: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. static char file[MAXPATHLEN + 3]; data/rdist-6.1.5/src/filesys.c:114:17: [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. (void) strcpy(file, "./"); data/rdist-6.1.5/src/filesys.c:147:3: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((char *) &filestat, (char *) statbuf, sizeof(filestat)); data/rdist-6.1.5/src/filesys.c:276:3: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((char *) &mntstat, (char *) newmi->mi_statb, data/rdist-6.1.5/src/isexec.c:292:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(file, O_RDONLY, 0)) < 0) data/rdist-6.1.5/src/lookup.c:144: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 ebuf[BUFSIZ]; data/rdist-6.1.5/src/lookup.c:158:12: [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. (void) sprintf(ebuf, "%.*s redefined", data/rdist-6.1.5/src/lookup.c:168:10: [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. (void) sprintf(ebuf, "%.*s undefined", data/rdist-6.1.5/src/message.c:124: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:128:10: [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. (void) sprintf(buf, " %.*s=", data/rdist-6.1.5/src/message.c:180: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. static char ebuf[BUFSIZ]; data/rdist-6.1.5/src/message.c:190:10: [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. (void) sprintf(ebuf, data/rdist-6.1.5/src/message.c:211:26: [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 ((msgfac->mf_fptr = fopen(strptr, "w")) == NULL) data/rdist-6.1.5/src/message.c:257:11: [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. (void) sprintf(ebuf, data/rdist-6.1.5/src/message.c:274: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. static char ebuf[BUFSIZ], msgbuf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:302:11: [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. (void) sprintf(ebuf, data/rdist-6.1.5/src/message.c:479:8: [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). fd = mkstemp(msgfac->mf_filename); data/rdist-6.1.5/src/message.c:502: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. static char mbuf[MAXHOSTNAMELEN]; data/rdist-6.1.5/src/message.c:524: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. static char mbuf[2048]; data/rdist-6.1.5/src/message.c:590: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:612: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:633: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:659: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:681: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:701: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:715: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:737: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:758: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:779: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:795: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:821: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:840: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/message.c:859: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. static char buf[MSGBUFSIZ]; data/rdist-6.1.5/src/rdist.c:181:21: [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). min_freespace = atoi(optarg); data/rdist-6.1.5/src/rdist.c:183:21: [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). min_freefiles = atoi(optarg); data/rdist-6.1.5/src/rdist.c:185:19: [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). maxchildren = atoi(optarg); data/rdist-6.1.5/src/rdist.c:187: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). rtimeout = atoi(optarg); data/rdist-6.1.5/src/rdist.c:341:7: [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(file, "r"); data/rdist-6.1.5/src/rdist.c:441: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. static char buf[16384]; data/rdist-6.1.5/src/rdist.c:451:11: [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. (void) strcpy(buf, data/rdist-6.1.5/src/rdist.c:461:9: [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. (void) strcat(buf, " )"); data/rdist-6.1.5/src/regex.c:136:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 expbuf[ESIZE], *braslist[NBRA], *braelist[NBRA]; data/rdist-6.1.5/src/regex.c:149: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 bracket[NBRA]; data/rdist-6.1.5/src/server.c:58: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 tempname[sizeof _RDIST_TMP + 1]; /* Tmp file name */ data/rdist-6.1.5/src/server.c:59: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 buf[BUFSIZ]; /* general purpose buffer */ data/rdist-6.1.5/src/server.c:60: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 target[MAXPATHLEN]; /* target/source directory name */ data/rdist-6.1.5/src/server.c:63: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 *sptarget[32]; /* stack of saved ptarget's for directories */ data/rdist-6.1.5/src/server.c:178:21: [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). gr = getgrgid(atoi(name + 1)); data/rdist-6.1.5/src/server.c:194: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. static char last_group[128]; data/rdist-6.1.5/src/server.c:195: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. static char last_owner[128]; data/rdist-6.1.5/src/server.c:208: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). uid = (UID_T) atoi(owner + 1); data/rdist-6.1.5/src/server.c:232: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). gid = (GID_T) atoi(group + 1); data/rdist-6.1.5/src/server.c:707: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. static char savefile[MAXPATHLEN]; data/rdist-6.1.5/src/server.c:770:39: [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). if (chkparent(new, opts) < 0 || (f = mkstemp(new)) < 0) { data/rdist-6.1.5/src/server.c:857:13: [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 ((f1 = fopen(target, "r")) == NULL) { data/rdist-6.1.5/src/server.c:864:13: [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 ((f2 = fopen(new, "r")) == NULL) { data/rdist-6.1.5/src/server.c:987: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. static char lowner[100], lgroup[100]; data/rdist-6.1.5/src/server.c:1168: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 tbuf[MAXPATHLEN]; data/rdist-6.1.5/src/server.c:1238: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. static char expbuf[BUFSIZ]; data/rdist-6.1.5/src/server.c:1365: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 new[MAXPATHLEN]; data/rdist-6.1.5/src/server.c:1582: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. static char cmdbuf[BUFSIZ]; data/rdist-6.1.5/src/server.c:1623: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). proto_version = atoi(&cmdbuf[1]); data/rdist-6.1.5/src/setargs.c:128: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. static char buf[BUFSIZ]; data/rdist-6.1.5/src/setargs.c:146: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. static char buf[BUFSIZ]; data/rdist-6.1.5/src/setargs.c:164: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. static char buf[BUFSIZ]; data/rdist-6.1.5/src/strerror.c:16: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 Unknown[100]; data/rdist-6.1.5/src/strerror.c:19: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. (void) sprintf(Unknown, "Error %d", Num); data/rdist-6.1.5/config/config-data.h:40: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). #define D_NAMLEN(p) (strlen((p)->d_name)) data/rdist-6.1.5/src/child.c:209:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((amt = read(child->c_readfd, rbuf, sizeof(rbuf))) > 0) { data/rdist-6.1.5/src/client.c:114: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). srclen = strlen(src); data/rdist-6.1.5/src/client.c:115:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pathlen = strlen(path); data/rdist-6.1.5/src/client.c:124: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). cp = path + srclen - strlen(p); data/rdist-6.1.5/src/client.c:443:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(f, buf, amt) != amt) { data/rdist-6.1.5/src/client.c:623: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). if (len + 1 + (int) strlen(dp->d_name) >= MAXPATHLEN - 1) { data/rdist-6.1.5/src/client.c:1043: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). len = strlen(rname); data/rdist-6.1.5/src/common.c:302:10: [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. (void) strcat(msg + 1, "\n"); data/rdist-6.1.5/src/common.c:305: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). len = strlen(msg); data/rdist-6.1.5/src/common.c:307: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). len = strlen(msg + 1) + 1; data/rdist-6.1.5/src/common.c:408:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(read(fd, (char *)buf, bufsiz)); data/rdist-6.1.5/src/common.c:841:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((i = read(fd[PIPE_READ], buf, sizeof(buf))) > 0) { data/rdist-6.1.5/src/distopt.c:126:11: [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. (void) strcat(buf, ","); data/rdist-6.1.5/src/distopt.c:151:11: [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. (void) strcat(buf, ","); data/rdist-6.1.5/src/docmd.c:183:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((len = read(fd, buf, sizeof(buf))) > 0) data/rdist-6.1.5/src/docmd.c:207: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). l = strlen(cmd->c_name); data/rdist-6.1.5/src/docmd.c:342:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((char *)tuser, rhost, sizeof(tuser)-1); data/rdist-6.1.5/src/docmd.c:647: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 (len + 1 + (int)strlen(dp->d_name) >= BUFSIZ - 1) { data/rdist-6.1.5/src/docmd.c:721: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). int len = strlen(*env); data/rdist-6.1.5/src/docmd.c:723: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). strlen(name) + 2); data/rdist-6.1.5/src/docmd.c:726:12: [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. (void) strcat(*env, ":"); data/rdist-6.1.5/src/docmd.c:801:14: [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). int len = strlen(env); data/rdist-6.1.5/src/docmd.c:804: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). len + strlen(sc->sc_name) + 2); data/rdist-6.1.5/src/expand.c:87: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). int len = strlen((char *)s1) + strlen((char *)s2) + 2; data/rdist-6.1.5/src/expand.c:87: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). int len = strlen((char *)s1) + strlen((char *)s2) + 2; data/rdist-6.1.5/src/expand.c:212: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). if ((int)strlen((char *)s) > sizeof(varbuff)) { data/rdist-6.1.5/src/filesys.c:96: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 ((int)strlen(pathname) > sizeof(file)+3) { data/rdist-6.1.5/src/filesys.c:152: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). p = &file[strlen(file) - 1]; data/rdist-6.1.5/src/isexec.c:83:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &hdr, sizeof(hdr)) == sizeof(hdr)) { data/rdist-6.1.5/src/isexec.c:175:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &hdr, sizeof(hdr)) == sizeof(hdr)) { data/rdist-6.1.5/src/isexec.c:221:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((read(fd, &ehdr, sizeof(ehdr)) == sizeof(ehdr)) && data/rdist-6.1.5/src/isexec.c:255:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((read(fd, &ehdr, sizeof(ehdr)) == sizeof(ehdr)) && data/rdist-6.1.5/src/message.c:134:13: [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. (void) strcat(buf, ","); data/rdist-6.1.5/src/message.c:296: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). if ((int)strlen(word) <= 0) data/rdist-6.1.5/src/message.c:298: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). if ((int)strlen(cp) <= 0) data/rdist-6.1.5/src/message.c:474: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). tempfile = (char *) xmalloc(strlen(cp) + 1 + data/rdist-6.1.5/src/message.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(_RDIST_TMP) + 2); data/rdist-6.1.5/src/message.c:534: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(currenthost, msgbuf, strlen(currenthost)) == 0) data/rdist-6.1.5/src/message.c:539:10: [1] (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 character. (void) strcpy(mbuf, ""); data/rdist-6.1.5/src/rdist.c:444:9: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. (void) sprintf(buf, "("); data/rdist-6.1.5/src/rdist.c:449: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). len += strlen(nl->n_name) + 2; data/rdist-6.1.5/src/rdist.c:456:10: [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. (void) strcat(buf, " "); data/rdist-6.1.5/src/server.c:75: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). if (strlen(string) + strlen(target) + 2 > sizeof(target)) { data/rdist-6.1.5/src/server.c:75: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). if (strlen(string) + strlen(target) + 2 > sizeof(target)) { data/rdist-6.1.5/src/server.c:371: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 (len + 1 + (int)strlen(dp->d_name) >= MAXPATHLEN - 1) { data/rdist-6.1.5/src/server.c:445: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 (len + 1 + (int)strlen(dp->d_name) >= MAXPATHLEN - 1) { data/rdist-6.1.5/src/server.c:530: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). len = (2 * sizeof(E_FILES)) + strlen(cp) + 10; data/rdist-6.1.5/src/server.c:535: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(env); data/rdist-6.1.5/src/server.c:537:14: [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(cp) + 2); data/rdist-6.1.5/src/server.c:539:12: [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. (void) strcat(env, ":"); data/rdist-6.1.5/src/server.c:547: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(env); data/rdist-6.1.5/src/server.c:549:14: [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(cp) + 2); data/rdist-6.1.5/src/server.c:551:12: [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. (void) strcat(env, ";"); data/rdist-6.1.5/src/server.c:709: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). if (strlen(file) + sizeof(SAVE_SUFFIX) + 1 > MAXPATHLEN) { data/rdist-6.1.5/src/server.c:870:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc(f1)) == getc(f2)) data/rdist-6.1.5/src/server.c:870:28: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc(f1)) == getc(f2)) data/rdist-6.1.5/src/server.c:933:21: [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). ptarget = &target[strlen(target)]; data/rdist-6.1.5/src/server.c:1437:17: [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). file = group + strlen(group) + 1; data/rdist-6.1.5/src/server.c:1597:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask(oumask = umask(0)); data/rdist-6.1.5/src/server.c:1597:24: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask(oumask = umask(0)); data/rdist-6.1.5/src/setargs.c:90: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). LastArgv = envp[i-1] + strlen(envp[i-1]); data/rdist-6.1.5/src/setargs.c:92: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). LastArgv = argv[argc-1] + strlen(argv[argc-1]); data/rdist-6.1.5/src/setargs.c:109: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). i = strlen(msg); data/rdist-6.1.5/src/strdup.c:18:21: [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 ((p = malloc(strlen(str)+1)) == NULL) ANALYSIS SUMMARY: Hits = 299 Lines analyzed = 15926 in approximately 0.37 seconds (43470 lines/second) Physical Source Lines of Code (SLOC) = 8370 Hits@level = [0] 34 [1] 65 [2] 132 [3] 4 [4] 92 [5] 6 Hits@level+ = [0+] 333 [1+] 299 [2+] 234 [3+] 102 [4+] 98 [5+] 6 Hits/KSLOC@level+ = [0+] 39.7849 [1+] 35.7228 [2+] 27.957 [3+] 12.1864 [4+] 11.7085 [5+] 0.716846 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.