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/fgetty-0.7/checkpassword-pam2.c Examining data/fgetty-0.7/fmt.h Examining data/fgetty-0.7/fmt_ulong.c Examining data/fgetty-0.7/checkpassword-pam.c Examining data/fgetty-0.7/fgetty.c Examining data/fgetty-0.7/login.c Examining data/fgetty-0.7/login2.c Examining data/fgetty-0.7/checkpassword.c FINAL RESULTS: data/fgetty-0.7/fgetty.c:84:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(tty,0,0) || chmod(tty,0600)) data/fgetty-0.7/fgetty.c:84:25: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chown(tty,0,0) || chmod(tty,0600)) data/fgetty-0.7/login2.c:75:2: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(tty,u,gid); data/fgetty-0.7/checkpassword-pam.c:50:43: [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). *ep=alloca(strlen(pw->pw_shell)+7); strcat(strcpy(*ep,"SHELL="),pw->pw_shell); ++ep; data/fgetty-0.7/checkpassword-pam.c:51:36: [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). *ep=alloca(strlen(login)+6); strcat(strcpy(*ep,"USER="),login); ++ep; data/fgetty-0.7/checkpassword-pam.c:52:41: [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). *ep=alloca(strlen(pw->pw_dir)+7); strcat(strcpy(*ep,"HOME="),pw->pw_dir); ++ep; data/fgetty-0.7/checkpassword.c:56:29: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. if (!*passwd || !strcmp(crypt(ptr,passwd),passwd)) { data/fgetty-0.7/checkpassword.c:69:43: [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). *ep=alloca(strlen(pw->pw_shell)+7); strcat(strcpy(*ep,"SHELL="),pw->pw_shell); ++ep; data/fgetty-0.7/checkpassword.c:70:36: [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). *ep=alloca(strlen(login)+6); strcat(strcpy(*ep,"USER="),login); ++ep; data/fgetty-0.7/checkpassword.c:71:41: [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). *ep=alloca(strlen(pw->pw_dir)+7); strcat(strcpy(*ep,"HOME="),pw->pw_dir); ++ep; data/fgetty-0.7/fgetty.c:288: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(ttybuf2+4,ttybuf); data/fgetty-0.7/login.c:93: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(buf,username); data/fgetty-0.7/login.c:118:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(buf,username); data/fgetty-0.7/login2.c:100:5: [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). strcat(buf,login); data/fgetty-0.7/login2.c:106:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(argv0+1,tmp); data/fgetty-0.7/checkpassword-pam2.c:103:50: [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. retval = pam_set_item(pamh, PAM_TTY, (void *)getenv("TTY")); data/fgetty-0.7/login.c:78:16: [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 *host=getenv("HOST"); data/fgetty-0.7/login2.c:48:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. memcpy(ut.ut_id,getenv("TTY")+4+3,sizeof(ut.ut_id)); data/fgetty-0.7/login2.c:62:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *shell=getenv("SHELL"); data/fgetty-0.7/login2.c:64:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *login=getenv("USER"); data/fgetty-0.7/login2.c:68:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *tmp=getenv("UID"); data/fgetty-0.7/login2.c:69:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *tty=getenv("TTY"); data/fgetty-0.7/checkpassword-pam.c:18:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[513]; data/fgetty-0.7/checkpassword-pam.c:39:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100]; data/fgetty-0.7/checkpassword-pam.c:50:50: [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. *ep=alloca(strlen(pw->pw_shell)+7); strcat(strcpy(*ep,"SHELL="),pw->pw_shell); ++ep; data/fgetty-0.7/checkpassword-pam.c:51:43: [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. *ep=alloca(strlen(login)+6); strcat(strcpy(*ep,"USER="),login); ++ep; data/fgetty-0.7/checkpassword-pam.c:52:48: [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. *ep=alloca(strlen(pw->pw_dir)+7); strcat(strcpy(*ep,"HOME="),pw->pw_dir); ++ep; data/fgetty-0.7/checkpassword-pam.c:53:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf,"UID="); data/fgetty-0.7/checkpassword.c:33:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[513]; data/fgetty-0.7/checkpassword.c:58:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100]; data/fgetty-0.7/checkpassword.c:69:50: [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. *ep=alloca(strlen(pw->pw_shell)+7); strcat(strcpy(*ep,"SHELL="),pw->pw_shell); ++ep; data/fgetty-0.7/checkpassword.c:70:43: [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. *ep=alloca(strlen(login)+6); strcat(strcpy(*ep,"USER="),login); ++ep; data/fgetty-0.7/checkpassword.c:71:48: [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. *ep=alloca(strlen(pw->pw_dir)+7); strcat(strcpy(*ep,"HOME="),pw->pw_dir); ++ep; data/fgetty-0.7/checkpassword.c:72:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf,"UID="); data/fgetty-0.7/fgetty.c:18: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 hn[MAXHOSTNAMELEN + 6]="HOST="; data/fgetty-0.7/fgetty.c:46: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). int fd=open(_PATH_UTMP,O_RDWR); data/fgetty-0.7/fgetty.c:63:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ut.ut_user,"LOGIN",6); data/fgetty-0.7/fgetty.c:71: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(_PATH_WTMP,O_APPEND|O_WRONLY))>=0) { data/fgetty-0.7/fgetty.c:93: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(tty, O_RDWR, 0))<0) data/fgetty-0.7/fgetty.c:103:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (open(tty,O_RDWR,0) != 0) data/fgetty-0.7/fgetty.c:128: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. char buf[30]; data/fgetty-0.7/fgetty.c:173:15: [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). int fd=open(_PATH_UTMP,O_RDWR); data/fgetty-0.7/fgetty.c:174: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. char buf[20]; data/fgetty-0.7/fgetty.c:199: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). int fd=open("/etc/issue",O_RDONLY); data/fgetty-0.7/fgetty.c:231: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 logname[40]; data/fgetty-0.7/fgetty.c:263: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 ttybuf[20]="/dev/"; data/fgetty-0.7/fgetty.c:264: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 ttybuf2[25]="TTY="; data/fgetty-0.7/fgetty.c:281:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ttybuf,"/dev/vc/"); strncpy(ttybuf+8,tty,3); data/fgetty-0.7/login.c:65: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 __username[100]; data/fgetty-0.7/login.c:66: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 password[100]; data/fgetty-0.7/login.c:94:5: [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(buf,"'s password: "); data/fgetty-0.7/login.c:115:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/fgetty-0.7/login.c:125:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf+len+1,"nosetuid"); data/fgetty-0.7/login.c:134: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). utmpfd=open(_PATH_UTMP,O_RDWR); data/fgetty-0.7/login.c:135:29: [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 (utmpfd==-1) utmpfd=open("/dev/null",O_RDWR); data/fgetty-0.7/login.c:137: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). wtmpfd=open(_PATH_WTMP,O_APPEND|O_WRONLY); data/fgetty-0.7/login.c:138:29: [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 (wtmpfd==-1) wtmpfd=open("/dev/null",O_WRONLY); data/fgetty-0.7/login2.c:84: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(".hushlogin",O_RDONLY))>=0) data/fgetty-0.7/login2.c:87:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd=open("/etc/motd",O_RDONLY))>=0) { data/fgetty-0.7/login2.c:88:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/fgetty-0.7/login2.c:99:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf,"LOGNAME="); data/fgetty-0.7/checkpassword-pam.c:27:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tmp=read(3,buf+len,512-len); data/fgetty-0.7/checkpassword-pam.c:36: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). ptr=login+strlen(login)+1; data/fgetty-0.7/checkpassword-pam.c:50: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). *ep=alloca(strlen(pw->pw_shell)+7); strcat(strcpy(*ep,"SHELL="),pw->pw_shell); ++ep; data/fgetty-0.7/checkpassword-pam.c:51:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *ep=alloca(strlen(login)+6); strcat(strcpy(*ep,"USER="),login); ++ep; data/fgetty-0.7/checkpassword-pam.c:52: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). *ep=alloca(strlen(pw->pw_dir)+7); strcat(strcpy(*ep,"HOME="),pw->pw_dir); ++ep; data/fgetty-0.7/checkpassword-pam.c:58: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). ptr+=strlen(ptr)+1; /* skip password */ data/fgetty-0.7/checkpassword-pam.c:64:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ptr+=strlen(ptr)+1; /* skip timestamp */ data/fgetty-0.7/checkpassword.c:16:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). write(2,message,strlen(message)); data/fgetty-0.7/checkpassword.c:43:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tmp=read(3,buf+len,512-len); data/fgetty-0.7/checkpassword.c:55: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). ptr=login+strlen(login)+1; data/fgetty-0.7/checkpassword.c:69: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). *ep=alloca(strlen(pw->pw_shell)+7); strcat(strcpy(*ep,"SHELL="),pw->pw_shell); ++ep; data/fgetty-0.7/checkpassword.c:70: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). *ep=alloca(strlen(login)+6); strcat(strcpy(*ep,"USER="),login); ++ep; data/fgetty-0.7/checkpassword.c:71: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). *ep=alloca(strlen(pw->pw_dir)+7); strcat(strcpy(*ep,"HOME="),pw->pw_dir); ++ep; data/fgetty-0.7/checkpassword.c:77: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). ptr+=strlen(ptr)+1; /* skip password */ data/fgetty-0.7/checkpassword.c:83:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ptr+=strlen(ptr)+1; /* skip timestamp */ data/fgetty-0.7/fgetty.c:26:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). write(2,message,strlen(message)); data/fgetty-0.7/fgetty.c:51:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len=read(fd,&ut,sizeof(ut)); data/fgetty-0.7/fgetty.c:117: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). case 's': write(1,uts.sysname,strlen(uts.sysname)); break; data/fgetty-0.7/fgetty.c:118:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). case 'n': write(1,uts.nodename,strlen(uts.nodename)); break; data/fgetty-0.7/fgetty.c:119: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). case 'r': write(1,uts.release,strlen(uts.release)); break; data/fgetty-0.7/fgetty.c:120: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). case 'v': write(1,uts.version,strlen(uts.version)); break; data/fgetty-0.7/fgetty.c:121: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). case 'm': write(1,uts.machine,strlen(uts.machine)); break; data/fgetty-0.7/fgetty.c:122: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). case 'o': write(1,uts.domainname,strlen(uts.domainname)); break; data/fgetty-0.7/fgetty.c:143: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). write(1,buf,strlen(buf)); data/fgetty-0.7/fgetty.c:167: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). case 'l': write(1,tty+5,strlen(tty)-5); break; data/fgetty-0.7/fgetty.c:178:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len=read(fd,&ut,sizeof(ut)); data/fgetty-0.7/fgetty.c:208:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd,buf,length); data/fgetty-0.7/fgetty.c:237:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(0,c,1)<1) { data/fgetty-0.7/fgetty.c:255:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). write(1,logname,strlen(logname)); data/fgetty-0.7/fgetty.c:277:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ttybuf,tty,15); data/fgetty-0.7/fgetty.c:281:32: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strcpy(ttybuf,"/dev/vc/"); strncpy(ttybuf+8,tty,3); data/fgetty-0.7/fgetty.c:286:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ttybuf+5,tty,10); data/fgetty-0.7/login.c:80: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(host); data/fgetty-0.7/login.c:86:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). pwlen=read(0,__username,9); data/fgetty-0.7/login.c:92:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf=alloca(strlen(username)+20); data/fgetty-0.7/login.c:98:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). pwlen=read(0,password,99); data/fgetty-0.7/login.c:117: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(username)+1; data/fgetty-0.7/login.c:120: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). len+=strlen(password)+1; data/fgetty-0.7/login2.c:38:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len=read(fd,&ut,sizeof(ut)); data/fgetty-0.7/login2.c:50:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ut.ut_user,login,sizeof(ut.ut_user)); data/fgetty-0.7/login2.c:90:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((len=read(fd,buf,1024))>0) data/fgetty-0.7/login2.c:98: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). char *buf=alloca(strlen(login)+20); data/fgetty-0.7/login2.c:104: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). char *argv0=alloca(strlen(shell)+2); ANALYSIS SUMMARY: Hits = 104 Lines analyzed = 921 in approximately 0.08 seconds (12249 lines/second) Physical Source Lines of Code (SLOC) = 764 Hits@level = [0] 2 [1] 43 [2] 39 [3] 7 [4] 12 [5] 3 Hits@level+ = [0+] 106 [1+] 104 [2+] 61 [3+] 22 [4+] 15 [5+] 3 Hits/KSLOC@level+ = [0+] 138.743 [1+] 136.126 [2+] 79.8429 [3+] 28.7958 [4+] 19.6335 [5+] 3.9267 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.