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/rsh-redone-85/rlogind.c Examining data/rsh-redone-85/rshd.c Examining data/rsh-redone-85/rcp.c Parsing failed to find end of parameter list; semicolon terminated it in (buf, "T%li %li %li %li", case 'E': if(!dir || buf[1]) return -1; safewrite(0, "", 1); return 0; case 'D': if(sscanf(buf, "D%04o %li %1024s", &type, &mode, &size, name) != Examining data/rsh-redone-85/rlogin.c Examining data/rsh-redone-85/rsh.c FINAL RESULTS: data/rsh-redone-85/rcp.c:729:8: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path, mode); data/rsh-redone-85/rlogind.c:505:3: [4] (shell) execle: 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. execle("/bin/login", "login", "-p", "-h", host, "-f", pamuser, NULL, envp); data/rsh-redone-85/rsh.c:186:3: [4] (shell) execv: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execv(BINDIR "/rlogin", argv); data/rsh-redone-85/rshd.c:371:2: [4] (shell) execle: 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. execle(pw->pw_shell, shellname, "-c", command, NULL, pam_getenvlist(handle)); data/rsh-redone-85/rcp.c:937:15: [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((opt = getopt(argc, argv, "+rpdft")) != -1) { data/rsh-redone-85/rlogin.c:169:15: [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((opt = getopt(argc, argv, "l:p:46v")) != -1) { data/rsh-redone-85/rlogin.c:291: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. term = getenv("TERM")?:"network"; data/rsh-redone-85/rlogind.c:210:15: [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((opt = getopt(argc, argv, "+")) != -1) { data/rsh-redone-85/rsh.c:143:15: [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((opt = getopt(argc, argv, "-l:p:46vn")) != -1) { data/rsh-redone-85/rshd.c:114:15: [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((opt = getopt(argc, argv, "+")) != -1) { data/rsh-redone-85/rcp.c:327: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 lport[5]; data/rsh-redone-85/rcp.c:336: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 hostaddr[NI_MAXHOST]; data/rsh-redone-85/rcp.c:337: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 portnr[NI_MAXSERV]; data/rsh-redone-85/rcp.c:339:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4096]; data/rsh-redone-85/rcp.c:443:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/rsh-redone-85/rcp.c:485: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). file = open(argv[i], O_RDONLY); data/rsh-redone-85/rcp.c:522: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 name[1024]; data/rsh-redone-85/rcp.c:576: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). file = open(name, O_WRONLY | O_CREAT, mode); data/rsh-redone-85/rcp.c:605:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[65536]; data/rsh-redone-85/rcp.c:606: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 path[PATH_MAX]; data/rsh-redone-85/rcp.c:621:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(path, dname, slash[level] + 1); data/rsh-redone-85/rcp.c:716:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s, ring.buf + ring.off, part); data/rsh-redone-85/rcp.c:717:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s + part, ring.buf, offs); data/rsh-redone-85/rcp.c:719:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s, ring.buf + ring.off, r); data/rsh-redone-85/rcp.c:737: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). fd = open(path, O_WRONLY|O_CREAT, mode); data/rsh-redone-85/rcp.c:883:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZE]; data/rsh-redone-85/rcp.c:884: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 path[PATH_MAX]; data/rsh-redone-85/rlogin.c:128: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 lport[5]; data/rsh-redone-85/rlogin.c:143: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 hostaddr[NI_MAXHOST]; data/rsh-redone-85/rlogin.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 portnr[NI_MAXSERV]; data/rsh-redone-85/rlogin.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 buf[2][BUFLEN], *bufp[2]; data/rsh-redone-85/rlogin.c:393: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 wbuf[12]; data/rsh-redone-85/rlogin.c:409:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bufp[0] + len[0], wbuf, 12); data/rsh-redone-85/rlogind.c:121: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 reply[1024]; data/rsh-redone-85/rlogind.c:171: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 user[1024]; data/rsh-redone-85/rlogind.c:172: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 luser[1024]; data/rsh-redone-85/rlogind.c:173: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 term[1024]; data/rsh-redone-85/rlogind.c:183: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 host[NI_MAXHOST]; data/rsh-redone-85/rlogind.c:184: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 addr[NI_MAXHOST]; data/rsh-redone-85/rlogind.c:185: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 port[NI_MAXSERV]; data/rsh-redone-85/rlogind.c:187:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4096]; data/rsh-redone-85/rlogind.c:253:11: [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). portnr = atoi(port); data/rsh-redone-85/rlogind.c:425:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(winbuf, buf + i, 8); data/rsh-redone-85/rlogind.c:432:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + i - 4, buf + i + 8, len - i - 8); data/rsh-redone-85/rlogind.c:476: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 *envp[2]; data/rsh-redone-85/rlogind.c:492:23: [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). cfsetispeed(&tios, atoi(speed)); data/rsh-redone-85/rlogind.c:493:23: [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). cfsetospeed(&tios, atoi(speed)); data/rsh-redone-85/rsh.c:85: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((fd = open("/dev/null", O_RDONLY)) < 0) { data/rsh-redone-85/rsh.c:102: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 lport[5]; data/rsh-redone-85/rsh.c:114: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 hostaddr[NI_MAXHOST]; data/rsh-redone-85/rsh.c:115: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 portnr[NI_MAXSERV]; data/rsh-redone-85/rsh.c:117:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[3][BUFLEN], *bufp[3]; data/rsh-redone-85/rshd.c:80: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 user[1024]; data/rsh-redone-85/rshd.c:81: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 luser[1024]; data/rsh-redone-85/rshd.c:82: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 command[1024]; data/rsh-redone-85/rshd.c:83: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 env[1024]; data/rsh-redone-85/rshd.c:91: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 host[NI_MAXHOST]; data/rsh-redone-85/rshd.c:92: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 addr[NI_MAXHOST]; data/rsh-redone-85/rshd.c:93: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 port[NI_MAXSERV]; data/rsh-redone-85/rshd.c:94: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 eport[NI_MAXSERV]; data/rsh-redone-85/rshd.c:95: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 lport[NI_MAXSERV]; data/rsh-redone-85/rshd.c:157:11: [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). portnr = atoi(port); data/rsh-redone-85/rshd.c:171:12: [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). eportnr = atoi(eport); data/rsh-redone-85/rcp.c:93:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result = read(fd, buf, count); data/rsh-redone-85/rcp.c:139:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fd, ring->buf + o, c); data/rsh-redone-85/rcp.c:141:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fd, ring->buf + ring->off, c); data/rsh-redone-85/rcp.c:406:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). x = read(src, buf, sizeof(buf)); data/rsh-redone-85/rcp.c:423: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). if(safewrite(out, buf, strlen(buf)) == -1) data/rsh-redone-85/rcp.c:428:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(safewrite(out, buf, strlen(buf)) == -1) data/rsh-redone-85/rcp.c:447: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). if(safewrite(out, buf, strlen(buf)) == -1) data/rsh-redone-85/rcp.c:452:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(safewrite(out, buf, strlen(buf)) == -1) data/rsh-redone-85/rcp.c:472:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(safewrite(out, buf, strlen(buf)) == -1) data/rsh-redone-85/rcp.c:544:8: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if(sscanf(buf, "D%04o %li %1024s", &type, &mode, &size, name) != 4) data/rsh-redone-85/rcp.c:570:8: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if(sscanf(buf, "C%04o %li %1024s", &type, &mode, &size, name) != 4) data/rsh-redone-85/rcp.c:618: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). slash[level = 0] = strlen(dname); data/rsh-redone-85/rcp.c:855: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). safewrite(sock, luser, strlen(luser) + 1) == -1 || data/rsh-redone-85/rcp.c:856: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). safewrite(sock, user, strlen(user) + 1) == -1 || data/rsh-redone-85/rcp.c:857: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). safewrite(sock, command, strlen(user) + 1) == -1) { data/rsh-redone-85/rcp.c:866:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(sock, buf, 1) != 1 || *buf) { data/rsh-redone-85/rlogin.c:329:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(sock, buf[0], 1) != 1 || *buf[0]) { data/rsh-redone-85/rlogin.c:453:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(winchpipe[0], &dummy, 1); data/rsh-redone-85/rlogin.c:460:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len[1] = read(sock, buf[1], BUFLEN); data/rsh-redone-85/rlogin.c:491:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len[0] = read(0, buf[0], BUFLEN); data/rsh-redone-85/rlogind.c:68:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result = read(fd, buf, 1); data/rsh-redone-85/rlogind.c:90:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result = read(infd, buf, 1); data/rsh-redone-85/rlogind.c:131:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(safewrite(1, msgv[i]->msg, strlen(msgv[i]->msg)) == -1) data/rsh-redone-85/rlogind.c:139:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(safewrite(1, msgv[i]->msg, strlen(msgv[i]->msg)) == -1) data/rsh-redone-85/rlogind.c:147:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(safewrite(1, msgv[i]->msg, strlen(msgv[i]->msg)) == -1) data/rsh-redone-85/rlogind.c:153:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(safewrite(1, msgv[i]->msg, strlen(msgv[i]->msg)) <= 0) data/rsh-redone-85/rlogind.c:262:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(0, buf, 1) != 1 || *buf) { data/rsh-redone-85/rlogind.c:414:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(0, buf, sizeof buf); data/rsh-redone-85/rlogind.c:444:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(master, buf, sizeof buf); data/rsh-redone-85/rsh.c:339:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(sock, buf[0], 1) != 1 || *buf[0]) { data/rsh-redone-85/rsh.c:387:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len[2] = read(esock, buf[2], BUFLEN); data/rsh-redone-85/rsh.c:424:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len[1] = read(sock, buf[1], BUFLEN); data/rsh-redone-85/rsh.c:459:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len[0] = read(0, buf[0], BUFLEN); data/rsh-redone-85/rshd.c:52:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result = read(fd, buf, 1); ANALYSIS SUMMARY: Hits = 97 Lines analyzed = 2900 in approximately 0.10 seconds (28272 lines/second) Physical Source Lines of Code (SLOC) = 2118 Hits@level = [0] 142 [1] 34 [2] 53 [3] 6 [4] 3 [5] 1 Hits@level+ = [0+] 239 [1+] 97 [2+] 63 [3+] 10 [4+] 4 [5+] 1 Hits/KSLOC@level+ = [0+] 112.842 [1+] 45.7979 [2+] 29.745 [3+] 4.72144 [4+] 1.88857 [5+] 0.472144 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.