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/xdm-1.1.11/chooser/chooser.c Examining data/xdm-1.1.11/config/xdm-config.cpp Examining data/xdm-1.1.11/config/Xreset.cpp Examining data/xdm-1.1.11/config/Xresources.cpp Examining data/xdm-1.1.11/config/Xservers.ws.cpp Examining data/xdm-1.1.11/config/Xsession.cpp Examining data/xdm-1.1.11/config/Xstartup.cpp Examining data/xdm-1.1.11/greeter/greet.c Examining data/xdm-1.1.11/greeter/Login.c Examining data/xdm-1.1.11/greeter/Login.h Examining data/xdm-1.1.11/greeter/LoginP.h Examining data/xdm-1.1.11/greeter/verify.c Examining data/xdm-1.1.11/include/dm.h Examining data/xdm-1.1.11/include/dm_auth.h Examining data/xdm-1.1.11/include/dm_error.h Examining data/xdm-1.1.11/include/dm_socket.h Examining data/xdm-1.1.11/include/greet.h Examining data/xdm-1.1.11/xdm/access.c Examining data/xdm-1.1.11/xdm/auth.c Examining data/xdm-1.1.11/xdm/choose.c Examining data/xdm-1.1.11/xdm/daemon.c Examining data/xdm-1.1.11/xdm/dm.c Examining data/xdm-1.1.11/xdm/dpylist.c Examining data/xdm-1.1.11/xdm/error.c Examining data/xdm-1.1.11/xdm/file.c Examining data/xdm-1.1.11/xdm/genauth.c Examining data/xdm-1.1.11/xdm/krb5auth.c Examining data/xdm-1.1.11/xdm/mitauth.c Examining data/xdm-1.1.11/xdm/netaddr.c Examining data/xdm-1.1.11/xdm/policy.c Examining data/xdm-1.1.11/xdm/prngc.c Examining data/xdm-1.1.11/xdm/protodpy.c Examining data/xdm-1.1.11/xdm/reset.c Examining data/xdm-1.1.11/xdm/resource.c Examining data/xdm-1.1.11/xdm/rpcauth.c Examining data/xdm-1.1.11/xdm/server.c Examining data/xdm-1.1.11/xdm/session.c Examining data/xdm-1.1.11/xdm/socket.c Examining data/xdm-1.1.11/xdm/streams.c Examining data/xdm-1.1.11/xdm/util.c Examining data/xdm-1.1.11/xdm/xdmauth.c Examining data/xdm-1.1.11/xdm/xdmcp.c Examining data/xdm-1.1.11/xdmshell/xdmshell.c FINAL RESULTS: data/xdm-1.1.11/greeter/verify.c:433:8: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(krbtkfile, p->pw_uid, p->pw_gid); data/xdm-1.1.11/xdm/auth.c:113:5: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. int chown(int a,int b,int c) {} data/xdm-1.1.11/xdm/auth.c:352:14: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. (void) chown(d->authFile, 0, statb.st_gid); data/xdm-1.1.11/xdm/auth.c:354:14: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. (void) chmod(d->authFile, statb.st_mode & 0700); data/xdm-1.1.11/xdm/auth.c:1438:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod (new_name, (int) (statb.st_mode & 0777)); data/xdm-1.1.11/xdm/auth.c:1478:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown (envname, verify->uid, verify->gid); data/xdm-1.1.11/xdm/auth.c:1523:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod (new_name, (int) (statb.st_mode & 0777)); data/xdm-1.1.11/config/Xsession.cpp:23:40: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). XCOMM Since this system doesn't have a mktemp command to allow secure data/xdm-1.1.11/config/Xsession.cpp:74:47: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. XCOMM Allow the user to over-ride the system default desktop data/xdm-1.1.11/greeter/Login.c:962:6: [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(VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum), data/xdm-1.1.11/greeter/Login.c:1255:6: [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 (ctx->login.sessionArg, params[0]); data/xdm-1.1.11/greeter/verify.c:61:14: [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. extern char *crypt(const char *, const char *); data/xdm-1.1.11/greeter/verify.c:177:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path, sizeof(path), _PATH_AUTHPROG "%s", style); data/xdm-1.1.11/greeter/verify.c:468:14: [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 (strcmp (crypt (greet->password, user_pass), user_pass)) data/xdm-1.1.11/include/greet.h:213:10: [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. # define crypt (*__xdm_crypt) data/xdm-1.1.11/xdm/auth.c:386:13: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). (void) mktemp (d->authFile); data/xdm-1.1.11/xdm/auth.c:570:2: [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 (new_name, name); data/xdm-1.1.11/xdm/auth.c:1357:13: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). (void) mktemp (backup_name); data/xdm-1.1.11/xdm/dm.c:180:2: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(cmdbuf); data/xdm-1.1.11/xdm/error.c:52:11: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. len = vsnprintf (buf, sizeof(buf), fmt, args); data/xdm-1.1.11/xdm/error.c:107:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, fmt, args); data/xdm-1.1.11/xdm/krb5auth.c:71:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "FILE:%s/K5C", tmpdir); data/xdm-1.1.11/xdm/krb5auth.c:118:2: [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(new->data, filename); data/xdm-1.1.11/xdm/policy.c:139:16: [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. if ((fd = popen(willing, "r"))) data/xdm-1.1.11/xdm/server.c:108:9: [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. (void) execv (argv[0], argv); data/xdm-1.1.11/xdm/session.c:148:14: [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. extern char *crypt(CRYPT_ARGS); data/xdm-1.1.11/xdm/session.c:205:2: [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. crypt, data/xdm-1.1.11/xdm/session.c:419:28: [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 (d->resources[0] && access (d->resources, 4) == 0) { data/xdm-1.1.11/xdm/util.c:71:11: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. len = vsnprintf(buf, sizeof(buf), format, ap); data/xdm-1.1.11/xdm/util.c:78:3: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(*ret, len + 1, format, ap); data/xdm-1.1.11/xdm/xdmauth.c:234:24: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (line[0] == '#' || sscanf (line, "%s %s", id, key) != 2) data/xdm-1.1.11/xdm/xdmcp.c:1567:2: [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 (hostname, localHostname ()); data/xdm-1.1.11/xdmshell/xdmshell.c:75:9: [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 (filename, X_OK) != 0) return -1; data/xdm-1.1.11/xdmshell/xdmshell.c:81:2: [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 (filename, args); data/xdm-1.1.11/xdmshell/xdmshell.c:139: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 (cmdbuf, BINDIR); data/xdm-1.1.11/xdmshell/xdmshell.c:153: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 (cmdbuf, BINDIR); data/xdm-1.1.11/greeter/verify.c:113:8: [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. str = getenv(*envvar); data/xdm-1.1.11/xdm/dm.c:730: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. windowpath = getenv("WINDOWPATH"); data/xdm-1.1.11/xdm/krb5auth.c:65:14: [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. tmpdir = getenv("TMPDIR"); data/xdm-1.1.11/xdm/session.c:1011:10: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. value = getenv (*exp); data/xdm-1.1.11/chooser/chooser.c:592:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048], *cp, *cplim; data/xdm-1.1.11/chooser/chooser.c:606: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 ((ipfd=open( "/dev/ip", O_RDONLY )) < 0 ) data/xdm-1.1.11/chooser/chooser.c:716:6: [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 sport[8]; data/xdm-1.1.11/chooser/chooser.c:886: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/xdm-1.1.11/chooser/chooser.c:1152: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 strbuf[128]; data/xdm-1.1.11/greeter/Login.c:806:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *stateNames[4] = { data/xdm-1.1.11/greeter/Login.c:1366:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strbuf[128]; data/xdm-1.1.11/greeter/Login.h:190: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[NAME_LEN], passwd[PASSWORD_LEN]; data/xdm-1.1.11/greeter/greet.c:148: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 name[NAME_LEN], password[PASSWORD_LEN]; data/xdm-1.1.11/greeter/greet.c:544:6: [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 vtpath[16]; data/xdm-1.1.11/greeter/greet.c:663:6: [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 netname[MAXNETNAMELEN+1]; data/xdm-1.1.11/greeter/greet.c:664:6: [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 domainname[MAXNETNAMELEN+1]; data/xdm-1.1.11/greeter/greet.c:708:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *pam_msg_styles[5] data/xdm-1.1.11/greeter/verify.c:90: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 krbtkfile[MAXPATHLEN]; data/xdm-1.1.11/greeter/verify.c:129: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[MAXPATHLEN]; data/xdm-1.1.11/greeter/verify.c:373:15: [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 ((fs= fopen(SOLARIS_LOGIN_DEFAULTS, "r")) != NULL) data/xdm-1.1.11/greeter/verify.c:375: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 str[120]; data/xdm-1.1.11/greeter/verify.c:415: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 name[ANAME_SZ]; data/xdm-1.1.11/greeter/verify.c:416: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 realm[REALM_SZ]; data/xdm-1.1.11/xdm/access.c:145:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(localAddress.data, data/xdm-1.1.11/xdm/access.c:150:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(localAddress.data, data/xdm-1.1.11/xdm/access.c:232: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 wordBuffer[WORD_LEN]; data/xdm-1.1.11/xdm/access.c:593: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). datafile = fopen (accessFile, "r"); data/xdm-1.1.11/xdm/access.c:970: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(defaultMcastAddress.data, &addr6, data/xdm-1.1.11/xdm/auth.c:319:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cleanname[NAMELEN]; data/xdm-1.1.11/xdm/auth.c:372:11: [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 (d->authFile); data/xdm-1.1.11/xdm/auth.c:392: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). *file = fopen (d->authFile, "w"); data/xdm-1.1.11/xdm/auth.c:571:2: [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 (new_name, "-n"); data/xdm-1.1.11/xdm/auth.c:581: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). newfd = open (new_name, O_WRONLY | O_CREAT | O_EXCL, 0600); data/xdm-1.1.11/xdm/auth.c:600:14: [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). *oldp = fopen (name, "r"); data/xdm-1.1.11/xdm/auth.c:772: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 displayname[100]; data/xdm-1.1.11/xdm/auth.c:789: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 tmp_displayname[100]; data/xdm-1.1.11/xdm/auth.c:924:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addrret[1024]; /* easier than t_alloc */ data/xdm-1.1.11/xdm/auth.c:965:17: [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 ((ipfd = open ("/dev/ip", O_RDWR, 0 )) < 0) data/xdm-1.1.11/xdm/auth.c:1036:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048], *cp, *cplim; data/xdm-1.1.11/xdm/auth.c:1301:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char home_name[1024], backup_name[1024], new_name[1024]; data/xdm-1.1.11/xdm/auth.c:1348:11: [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 (backup_name); data/xdm-1.1.11/xdm/auth.c:1488:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[1024], new_name[1024]; data/xdm-1.1.11/xdm/choose.c:184:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char addr_buf[1024]; data/xdm-1.1.11/xdm/choose.c:186:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char result_buf[1024]; data/xdm-1.1.11/xdm/choose.c:380:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostbuf[1024]; data/xdm-1.1.11/xdm/choose.c:405:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/xdm-1.1.11/xdm/choose.c:515:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/xdm-1.1.11/xdm/choose.c:526: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, "-xdmaddress "); data/xdm-1.1.11/xdm/choose.c:529: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, "-clientaddress "); data/xdm-1.1.11/xdm/daemon.c:86: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). (void) open ("/dev/null", O_RDWR); data/xdm-1.1.11/xdm/dm.c:126:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmdbuf[1024]; data/xdm-1.1.11/xdm/dm.c:256:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lineBuf[10240]; data/xdm-1.1.11/xdm/dm.c:269:16: [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). serversFile = fopen (servers, "r"); data/xdm-1.1.11/xdm/dm.c:908:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pidstr[11]; /* enough space for a 32-bit pid plus \0 */ data/xdm-1.1.11/xdm/dm.c:914: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). pidFd = open (pidFile, O_WRONLY|O_CREAT|O_EXCL, 0666); data/xdm-1.1.11/xdm/dm.c:937:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). pidFd = open (pidFile, O_WRONLY|O_CREAT|O_EXCL, 0666); data/xdm-1.1.11/xdm/dm.c:944:16: [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). pidFilePtr = fopen (pidFile, "r"); data/xdm-1.1.11/xdm/error.c:49:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/xdm-1.1.11/xdm/genauth.c:47:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char key[8]; data/xdm-1.1.11/xdm/genauth.c:56:18: [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. typedef unsigned char auth_cblock[8]; /* block size */ data/xdm-1.1.11/xdm/genauth.c:270:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[0x1000]; data/xdm-1.1.11/xdm/genauth.c:272: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). if ((fd = open (name, O_RDONLY)) < 0) { data/xdm-1.1.11/xdm/genauth.c:356:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char tmpkey[8]; data/xdm-1.1.11/xdm/genauth.c:361: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). if ((fd = open(randomDevice, O_RDONLY)) >= 0) { data/xdm-1.1.11/xdm/genauth.c:407:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char data[8]; data/xdm-1.1.11/xdm/genauth.c:452: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). if ((fd = open(randomDevice, O_RDONLY)) >= 0) { data/xdm-1.1.11/xdm/genauth.c:477: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 (auth, tmp, len); data/xdm-1.1.11/xdm/krb5auth.c:117: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(new->data, "UU:"); data/xdm-1.1.11/xdm/mitauth.c:45: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 auth_name[256]; data/xdm-1.1.11/xdm/netaddr.c:258: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 astr[INET6_ADDRSTRLEN] = ""; data/xdm-1.1.11/xdm/policy.c:128:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char statusBuf[256]; data/xdm-1.1.11/xdm/prngc.c:65: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 msg[2]; data/xdm-1.1.11/xdm/resource.c:301:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str_buf[50]; data/xdm-1.1.11/xdm/resource.c:341:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *((int *) valuep) = atoi (str_buf); data/xdm-1.1.11/xdm/resource.c:447: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], class[1024]; data/xdm-1.1.11/xdm/resource.c:453:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char **) DmResources[i].dm_value, data/xdm-1.1.11/xdm/resource.c:485:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[1024], class[1024]; data/xdm-1.1.11/xdm/resource.c:486:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dpyName[512], dpyClass[512]; data/xdm-1.1.11/xdm/rpcauth.c:57:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char key[MAXNETNAMELEN+1]; data/xdm-1.1.11/xdm/server.c:76:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char arg[1024]; data/xdm-1.1.11/xdm/server.c:249:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/xdm-1.1.11/xdm/session.c:574:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *failsafeArgv[2]; data/xdm-1.1.11/xdm/session.c:732:6: [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 netname[MAXNETNAMELEN+1], secretkey[HEXKEYBYTES+1]; data/xdm-1.1.11/xdm/session.c:746: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(&(netst.st_priv_key), secretkey, HEXKEYBYTES); data/xdm-1.1.11/xdm/session.c:869:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char **args, *args_safe[2]; data/xdm-1.1.11/xdm/session.c:874:6: [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). f = fopen (file, "r"); data/xdm-1.1.11/xdm/session.c:929:5: [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). open ("/dev/null", O_RDONLY); data/xdm-1.1.11/xdm/session.c:942: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 program[1024], *e, *p, *optarg; data/xdm-1.1.11/xdm/session.c:954:6: [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). f = fopen (argv[0], "r"); data/xdm-1.1.11/xdm/socket.c:145:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addrbuf[INET6_ADDRSTRLEN]; data/xdm-1.1.11/xdm/socket.c:300: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(&sin->sin_addr, addr->data, addr->length); data/xdm-1.1.11/xdm/socket.c:322: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(&sin6->sin6_addr, addr->data, addr->length); data/xdm-1.1.11/xdm/socket.c:395: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(&mreq.imr_multiaddr, data/xdm-1.1.11/xdm/socket.c:398: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(&mreq.imr_interface, data/xdm-1.1.11/xdm/socket.c:429: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(&mreq6.ipv6mr_multiaddr, data/xdm-1.1.11/xdm/socket.c:441: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 addrbuf[INET6_ADDRSTRLEN]; data/xdm-1.1.11/xdm/socket.c:451: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 addrbuf[INET6_ADDRSTRLEN]; data/xdm-1.1.11/xdm/streams.c:61:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bindbuf[15]; data/xdm-1.1.11/xdm/util.c:68:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/xdm-1.1.11/xdm/util.c:76:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*ret, buf, len + 1); data/xdm-1.1.11/xdm/util.c:284: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 localHostbuf[256]; data/xdm-1.1.11/xdm/xdmauth.c:43: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 auth_name[256]; data/xdm-1.1.11/xdm/xdmauth.c:225:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[1024], id[1024], key[1024]; data/xdm-1.1.11/xdm/xdmauth.c:229:12: [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). keys = fopen (keyFile, "r"); data/xdm-1.1.11/xdm/xdmcp.c:250:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addrbuf[INET6_ADDRSTRLEN] = ""; data/xdm-1.1.11/xdm/xdmcp.c:1319: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 buf[256]; data/xdm-1.1.11/xdm/xdmcp.c:1415:6: [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 dotted[INET6_ADDRSTRLEN]; data/xdm-1.1.11/xdm/xdmcp.c:1417:6: [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 dotted[20]; data/xdm-1.1.11/xdm/xdmcp.c:1550:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostname[1024]; data/xdm-1.1.11/xdm/xdmcp.c:1586:14: [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). number = atoi (colon + 1); data/xdm-1.1.11/xdmshell/xdmshell.c:54:10: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. # define vfork() fork() data/xdm-1.1.11/xdmshell/xdmshell.c:77:19: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. switch (pid = vfork ()) { data/xdm-1.1.11/xdmshell/xdmshell.c:95:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[3]; data/xdm-1.1.11/xdmshell/xdmshell.c:110:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmdbuf[256]; data/xdm-1.1.11/xdmshell/xdmshell.c:111:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *args[10]; data/xdm-1.1.11/xdmshell/xdmshell.c:120: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). ttyfd = open ("/dev/tty", O_RDWR, 0); data/xdm-1.1.11/xdmshell/xdmshell.c:140: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 (cmdbuf, "/xdm"); data/xdm-1.1.11/xdmshell/xdmshell.c:154: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 (cmdbuf, "/kbd_mode"); data/xdm-1.1.11/chooser/chooser.c:383:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). XdmcpAllocARRAY8 (hostname, strlen (host)); data/xdm-1.1.11/chooser/chooser.c:703: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(name) == 8 && data/xdm-1.1.11/chooser/chooser.c:704:47: [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). FromHex(name, (char *)&in_addr.sin_addr, strlen(name)) == 0) data/xdm-1.1.11/config/Xsession.cpp:29:13: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). XCOMM if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null ) data/xdm-1.1.11/greeter/Login.c:293:47: [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 STRING_WIDTH(f, s) TEXT_WIDTH (f, s, strlen(s)) data/xdm-1.1.11/greeter/Login.c:361:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Cardinal length = strlen(text); data/xdm-1.1.11/greeter/Login.c:402: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). int textlen = strlen (text + offset); data/xdm-1.1.11/greeter/Login.c:407: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). textlen = strlen (text + offset); data/xdm-1.1.11/greeter/Login.c:630: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). DRAW_STRING (fail, x, y, start, strlen(start)); data/xdm-1.1.11/greeter/Login.c:651:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DRAW_STRING (fail, x, y, w->login.fail, strlen (w->login.fail)); data/xdm-1.1.11/greeter/Login.c:782:51: [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). DRAW_STRING (greet, gx, GREET_Y(w), GREETING(w), strlen (GREETING(w))); data/xdm-1.1.11/greeter/Login.c:787: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). CUR_PROMPT_TEXT(w,p), strlen (CUR_PROMPT_TEXT(w,p))); data/xdm-1.1.11/greeter/Login.c:832: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). messageLen = strlen(message); data/xdm-1.1.11/greeter/Login.c:840:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prompt, message, messageLen); data/xdm-1.1.11/greeter/Login.c:918:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(VALUE_TEXT(w, promptNum), value, VALUE_TEXT_MAX(w, promptNum)); data/xdm-1.1.11/greeter/Login.c:953:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (PROMPT_CURSOR(ctx,promptNum) < (int)strlen(VALUE_TEXT(ctx,promptNum))) { data/xdm-1.1.11/greeter/Login.c:1052: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). (int)strlen(VALUE_TEXT(ctx,ctx->login.activePrompt))) { data/xdm-1.1.11/greeter/Login.c:1106: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). CUR_PROMPT_CURSOR(ctx) = strlen (VALUE_TEXT(ctx, ctx->login.activePrompt)); data/xdm-1.1.11/greeter/Login.c:1253: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). ctx->login.sessionArg = XtMalloc (strlen (params[0]) + 1); data/xdm-1.1.11/greeter/Login.c:1428: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). if ((len + (int)strlen(VALUE_TEXT(ctx, promptNum)) >= data/xdm-1.1.11/greeter/Login.c:1431:3: [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(VALUE_TEXT(ctx, promptNum)) - 2; data/xdm-1.1.11/greeter/Login.c:1442: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). strlen (VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum))+1); data/xdm-1.1.11/greeter/greet.c:198: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). data->name, strlen (data->passwd)); data/xdm-1.1.11/greeter/greet.c:202:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (name, data->name, sizeof(name)); data/xdm-1.1.11/greeter/greet.c:204:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (password, data->passwd, sizeof(password)); data/xdm-1.1.11/greeter/greet.c:635: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). bzero (greet->name, strlen(greet->name)); data/xdm-1.1.11/greeter/greet.c:636: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). bzero (greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/greet.c:669:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). addr.length = strlen (netname); data/xdm-1.1.11/greeter/greet.c:791: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). bzero(r->resp, strlen(r->resp)); data/xdm-1.1.11/greeter/verify.c:142: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 (!p || strlen (greet->name) == 0) { data/xdm-1.1.11/greeter/verify.c:144: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:150: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:155: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:161: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:167: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:174: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). auth_setdata(as, greet->password, strlen(greet->password) + 1); data/xdm-1.1.11/greeter/verify.c:184: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:192: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:200: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 (!greet->allow_null_passwd && strlen(greet->password) == 0) { data/xdm-1.1.11/greeter/verify.c:207: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:220: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:250: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). if (!p || strlen (greet->name) == 0) { data/xdm-1.1.11/greeter/verify.c:252: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:303: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:346: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 (!p || strlen (greet->name) == 0) { data/xdm-1.1.11/greeter/verify.c:349: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:359: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:379: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). if(str[0] == '#' || strlen(str) < 8) data/xdm-1.1.11/greeter/verify.c:391: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:408: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:471: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(!greet->allow_null_passwd || strlen(p->pw_passwd) > 0) { data/xdm-1.1.11/greeter/verify.c:473: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:485: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:498: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:516: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:523: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). bzero(greet->password, strlen(greet->password)); data/xdm-1.1.11/greeter/verify.c:528: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). bzero(user_pass, strlen(user_pass)); /* in case shadow password */ data/xdm-1.1.11/xdm/access.c:250:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (file); data/xdm-1.1.11/xdm/access.c:258:18: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc (file)) != EOF && c != '\n') data/xdm-1.1.11/xdm/access.c:657: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). temp.length = strlen ((char *)temp.data); data/xdm-1.1.11/xdm/auth.c:342: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 (authDir) + strlen (authdir1) + strlen (authdir2) data/xdm-1.1.11/xdm/auth.c:342: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). len = strlen (authDir) + strlen (authdir1) + strlen (authdir2) data/xdm-1.1.11/xdm/auth.c:342:51: [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 (authDir) + strlen (authdir1) + strlen (authdir2) data/xdm-1.1.11/xdm/auth.c:343:5: [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 (cleanname) + 14; data/xdm-1.1.11/xdm/auth.c:410:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask (0077); data/xdm-1.1.11/xdm/auth.c:412:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (mask); data/xdm-1.1.11/xdm/auth.c:513: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). d->authNameLens[i] = strlen (d->authNames[i]); data/xdm-1.1.11/xdm/auth.c:575:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask (0077); data/xdm-1.1.11/xdm/auth.c:594:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask (mask); data/xdm-1.1.11/xdm/auth.c:795: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). writeAddr (FamilyLocal, strlen (tmp_displayname), tmp_displayname, data/xdm-1.1.11/xdm/auth.c:1224: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). auth->number_length = strlen (colon); data/xdm-1.1.11/xdm/auth.c:1227:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (number, colon, auth->number_length); data/xdm-1.1.11/xdm/choose.c:383: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 (addr->length == strlen ("BROADCAST") && data/xdm-1.1.11/xdm/choose.c:471:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read (client_fd, buf, sizeof (buf)); data/xdm-1.1.11/xdm/choose.c:527:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (FormatChooserArgument (buf + strlen (buf), sizeof (buf) - strlen (buf))) data/xdm-1.1.11/xdm/choose.c:527:67: [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 (FormatChooserArgument (buf + strlen (buf), sizeof (buf) - strlen (buf))) data/xdm-1.1.11/xdm/choose.c:530:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (FormatARRAY8 (&d->clientAddr, buf + strlen (buf), sizeof (buf) - strlen (buf))) data/xdm-1.1.11/xdm/choose.c:530:74: [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 (FormatARRAY8 (&d->clientAddr, buf + strlen (buf), sizeof (buf) - strlen (buf))) data/xdm-1.1.11/xdm/dm.c:129:22: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). if (((oldumask = umask(022)) & 002) == 002) data/xdm-1.1.11/xdm/dm.c:130:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask (oldumask); data/xdm-1.1.11/xdm/dm.c:133: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). TitleLen = (argv[argc - 1] + strlen(argv[argc - 1])) - Title; data/xdm-1.1.11/xdm/dm.c:282: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 (lineBuf); data/xdm-1.1.11/xdm/dm.c:974: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). pidstrlen = strlen (pidstr); data/xdm-1.1.11/xdm/file.c:99:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (args[nargs], wordStart, s - wordStart); data/xdm-1.1.11/xdm/genauth.c:278:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!(cnt = read (fd, buf, sizeof (buf)))) data/xdm-1.1.11/xdm/genauth.c:362:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (pollRandomDevice(fd) && read(fd, tmpkey, 8) == 8) { data/xdm-1.1.11/xdm/genauth.c:454:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, auth, len) == len) { data/xdm-1.1.11/xdm/krb5auth.c:68: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). name = malloc(strlen(tmpdir) + strlen(dname) + 20); data/xdm-1.1.11/xdm/krb5auth.c:68: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). name = malloc(strlen(tmpdir) + strlen(dname) + 20); data/xdm-1.1.11/xdm/krb5auth.c:72: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). CleanUpFileName(dname, name+strlen(name), strlen(dname)+1); data/xdm-1.1.11/xdm/krb5auth.c:72:47: [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). CleanUpFileName(dname, name+strlen(name), strlen(dname)+1); data/xdm-1.1.11/xdm/krb5auth.c:110: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). new->data = malloc (3 + strlen(filename) + 1); data/xdm-1.1.11/xdm/krb5auth.c:120: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). new->data_length = strlen(new->data); data/xdm-1.1.11/xdm/netaddr.c:107: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). *lenp = strlen(((struct sockaddr_un *)netaddrp)->sun_path); data/xdm-1.1.11/xdm/policy.c:145: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 (s && strlen(statusBuf) > 0) data/xdm-1.1.11/xdm/policy.c:146: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). statusBuf[strlen(statusBuf)-1] = 0; /* chop newline */ data/xdm-1.1.11/xdm/policy.c:159: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). status->length = strlen (statusBuf); data/xdm-1.1.11/xdm/prngc.c:79: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). strlen(socket_path) >= sizeof(addr_un.sun_path)) { data/xdm-1.1.11/xdm/prngc.c:99:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addr_un.sun_path, socket_path, data/xdm-1.1.11/xdm/prngc.c:102: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). strlen(socket_path) + 1; data/xdm-1.1.11/xdm/prngc.c:144:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (atomicio(read, fd, buf, len) != len) { data/xdm-1.1.11/xdm/resource.c:314: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 (string); data/xdm-1.1.11/xdm/resource.c:321: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 (*valuep) == len && !strncmp (*valuep, string, len)) data/xdm-1.1.11/xdm/resource.c:334:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (new_string, string, len); data/xdm-1.1.11/xdm/resource.c:339:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (str_buf, string, sizeof (str_buf)); data/xdm-1.1.11/xdm/resource.c:344:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (str_buf, string, sizeof (str_buf)); data/xdm-1.1.11/xdm/rpcauth.c:71: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). new->data_length = strlen(key); data/xdm-1.1.11/xdm/session.c:740: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 (passwd); data/xdm-1.1.11/xdm/session.c:745: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). keyret, strlen (secretkey)); data/xdm-1.1.11/xdm/session.c:781: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). bzero(secretkey, strlen(secretkey)); data/xdm-1.1.11/xdm/session.c:817:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bzero(passwd, strlen(passwd)); data/xdm-1.1.11/xdm/session.c:852:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bzero(passwd, strlen(passwd)); data/xdm-1.1.11/xdm/session.c:859:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bzero(passwd, strlen(passwd)); data/xdm-1.1.11/xdm/session.c:962: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). e = program + strlen (program) - 1; data/xdm-1.1.11/xdm/socket.c:82: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). registerHostname (name, strlen (name)); data/xdm-1.1.11/xdm/streams.c:81: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). registerHostname (name, strlen (name)); data/xdm-1.1.11/xdm/util.c:116: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). int l = strlen (name); data/xdm-1.1.11/xdm/util.c:121: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 (*e) > l && !strncmp (*e, name, l) && data/xdm-1.1.11/xdm/util.c:137: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 (name); data/xdm-1.1.11/xdm/util.c:145: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). if ((int)strlen (*old) > l && !strncmp (*old, name, l) && (*old)[l] == '=') data/xdm-1.1.11/xdm/util.c:186:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(n, string,nl + 1); data/xdm-1.1.11/xdm/util.c:243:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). argv[i] = strncpy (save, word, string-word); data/xdm-1.1.11/xdm/xdmauth.c:237:48: [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). Debug ("Key entry for \"%s\" %d bytes\n", id, strlen(key)); data/xdm-1.1.11/xdm/xdmauth.c:238: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 (id) == displayID->length && data/xdm-1.1.11/xdm/xdmauth.c:244: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). keylen = strlen (key); data/xdm-1.1.11/xdm/xdmcp.c:634: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). snprintf(name + strlen(name), 10, ":%d", displayNumber); data/xdm-1.1.11/xdm/xdmcp.c:843: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). un_addr.sun_len = strlen(un_addr.sun_path); data/xdm-1.1.11/xdm/xdmcp.c:1326: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). status.length = strlen (buf); data/xdm-1.1.11/xdm/xdmcp.c:1562:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (hostname, name, colon - name); ANALYSIS SUMMARY: Hits = 283 Lines analyzed = 18170 in approximately 0.47 seconds (38368 lines/second) Physical Source Lines of Code (SLOC) = 14079 Hits@level = [0] 51 [1] 129 [2] 114 [3] 4 [4] 29 [5] 7 Hits@level+ = [0+] 334 [1+] 283 [2+] 154 [3+] 40 [4+] 36 [5+] 7 Hits/KSLOC@level+ = [0+] 23.7233 [1+] 20.1009 [2+] 10.9383 [3+] 2.84111 [4+] 2.557 [5+] 0.497194 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.