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/gdm3-3.38.2/chooser/chooser-main.c Examining data/gdm3-3.38.2/chooser/gdm-chooser-host.c Examining data/gdm3-3.38.2/chooser/gdm-chooser-host.h Examining data/gdm3-3.38.2/chooser/gdm-chooser-session.c Examining data/gdm3-3.38.2/chooser/gdm-chooser-session.h Examining data/gdm3-3.38.2/chooser/gdm-host-chooser-dialog.c Examining data/gdm3-3.38.2/chooser/gdm-host-chooser-dialog.h Examining data/gdm3-3.38.2/chooser/gdm-host-chooser-widget.c Examining data/gdm3-3.38.2/chooser/gdm-host-chooser-widget.h Examining data/gdm3-3.38.2/chooser/gdm-host-chooser.c Examining data/gdm3-3.38.2/common/gdm-address.c Examining data/gdm3-3.38.2/common/gdm-address.h Examining data/gdm3-3.38.2/common/gdm-common-unknown-origin.h Examining data/gdm3-3.38.2/common/gdm-common.c Examining data/gdm3-3.38.2/common/gdm-common.h Examining data/gdm3-3.38.2/common/gdm-log.c Examining data/gdm3-3.38.2/common/gdm-log.h Examining data/gdm3-3.38.2/common/gdm-profile.c Examining data/gdm3-3.38.2/common/gdm-profile.h Examining data/gdm3-3.38.2/common/gdm-settings-backend.c Examining data/gdm3-3.38.2/common/gdm-settings-backend.h Examining data/gdm3-3.38.2/common/gdm-settings-desktop-backend.c Examining data/gdm3-3.38.2/common/gdm-settings-desktop-backend.h Examining data/gdm3-3.38.2/common/gdm-settings-direct.c Examining data/gdm3-3.38.2/common/gdm-settings-direct.h Examining data/gdm3-3.38.2/common/gdm-settings-keys.h Examining data/gdm3-3.38.2/common/gdm-settings-utils.c Examining data/gdm3-3.38.2/common/gdm-settings-utils.h Examining data/gdm3-3.38.2/common/gdm-settings.c Examining data/gdm3-3.38.2/common/gdm-settings.h Examining data/gdm3-3.38.2/common/test-log.c Examining data/gdm3-3.38.2/daemon/gdm-dbus-util.c Examining data/gdm3-3.38.2/daemon/gdm-dbus-util.h Examining data/gdm3-3.38.2/daemon/gdm-display-access-file.c Examining data/gdm3-3.38.2/daemon/gdm-display-access-file.h Examining data/gdm3-3.38.2/daemon/gdm-display-factory.c Examining data/gdm3-3.38.2/daemon/gdm-display-factory.h Examining data/gdm3-3.38.2/daemon/gdm-display-store.c Examining data/gdm3-3.38.2/daemon/gdm-display-store.h Examining data/gdm3-3.38.2/daemon/gdm-display.c Examining data/gdm3-3.38.2/daemon/gdm-display.h Examining data/gdm3-3.38.2/daemon/gdm-launch-environment.c Examining data/gdm3-3.38.2/daemon/gdm-launch-environment.h Examining data/gdm3-3.38.2/daemon/gdm-legacy-display.c Examining data/gdm3-3.38.2/daemon/gdm-legacy-display.h Examining data/gdm3-3.38.2/daemon/gdm-local-display-factory.c Examining data/gdm3-3.38.2/daemon/gdm-local-display-factory.h Examining data/gdm3-3.38.2/daemon/gdm-local-display.c Examining data/gdm3-3.38.2/daemon/gdm-local-display.h Examining data/gdm3-3.38.2/daemon/gdm-manager.c Examining data/gdm3-3.38.2/daemon/gdm-manager.h Examining data/gdm3-3.38.2/daemon/gdm-server.h Examining data/gdm3-3.38.2/daemon/gdm-session-auditor.c Examining data/gdm3-3.38.2/daemon/gdm-session-auditor.h Examining data/gdm3-3.38.2/daemon/gdm-session-linux-auditor.c Examining data/gdm3-3.38.2/daemon/gdm-session-linux-auditor.h Examining data/gdm3-3.38.2/daemon/gdm-session-record.c Examining data/gdm3-3.38.2/daemon/gdm-session-record.h Examining data/gdm3-3.38.2/daemon/gdm-session-settings.c Examining data/gdm3-3.38.2/daemon/gdm-session-settings.h Examining data/gdm3-3.38.2/daemon/gdm-session-solaris-auditor.c Examining data/gdm3-3.38.2/daemon/gdm-session-solaris-auditor.h Examining data/gdm3-3.38.2/daemon/gdm-session-worker-common.c Examining data/gdm3-3.38.2/daemon/gdm-session-worker-common.h Examining data/gdm3-3.38.2/daemon/gdm-session-worker-job.c Examining data/gdm3-3.38.2/daemon/gdm-session-worker-job.h Examining data/gdm3-3.38.2/daemon/gdm-session-worker.c Examining data/gdm3-3.38.2/daemon/gdm-session-worker.h Examining data/gdm3-3.38.2/daemon/gdm-session.c Examining data/gdm3-3.38.2/daemon/gdm-session.h Examining data/gdm3-3.38.2/daemon/gdm-wayland-session.c Examining data/gdm3-3.38.2/daemon/gdm-x-session.c Examining data/gdm3-3.38.2/daemon/gdm-xdmcp-chooser-display.c Examining data/gdm3-3.38.2/daemon/gdm-xdmcp-chooser-display.h Examining data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c Examining data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.h Examining data/gdm3-3.38.2/daemon/gdm-xdmcp-display.c Examining data/gdm3-3.38.2/daemon/gdm-xdmcp-display.h Examining data/gdm3-3.38.2/daemon/main.c Examining data/gdm3-3.38.2/daemon/session-worker-main.c Examining data/gdm3-3.38.2/daemon/test-session-client.c Examining data/gdm3-3.38.2/daemon/gdm-server.c Examining data/gdm3-3.38.2/libgdm/gdm-client.c Examining data/gdm3-3.38.2/libgdm/gdm-client.h Examining data/gdm3-3.38.2/libgdm/gdm-sessions.c Examining data/gdm3-3.38.2/libgdm/gdm-sessions.h Examining data/gdm3-3.38.2/libgdm/gdm-user-switching.c Examining data/gdm3-3.38.2/libgdm/gdm-user-switching.h Examining data/gdm3-3.38.2/pam-extensions/gdm-pam-extensions.h Examining data/gdm3-3.38.2/pam_gdm/pam_gdm.c Examining data/gdm3-3.38.2/tests/m-common.c Examining data/gdm3-3.38.2/tests/s-common-address.c Examining data/gdm3-3.38.2/tests/s-common-address.h Examining data/gdm3-3.38.2/tests/s-common.c Examining data/gdm3-3.38.2/tests/s-common.h Examining data/gdm3-3.38.2/utils/gdm-disable-wayland.c Examining data/gdm3-3.38.2/utils/gdm-screenshot.c Examining data/gdm3-3.38.2/utils/gdmflexiserver.c FINAL RESULTS: data/gdm3-3.38.2/daemon/gdm-display-access-file.c:282:21: [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 (GDM_XAUTH_DIR, 0, gid) != 0) { data/gdm3-3.38.2/daemon/gdm-display-access-file.c:325:13: [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 (dir_name, uid, gid) < 0) { data/gdm3-3.38.2/daemon/gdm-launch-environment.c:351:13: [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 (path, uid, gid) == -1) { data/gdm3-3.38.2/daemon/main.c:164:13: [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 (path, uid, gid) == -1) { data/gdm3-3.38.2/daemon/gdm-display.c:1843:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (newwindowpath, "%s", nums); data/gdm3-3.38.2/daemon/gdm-display.c:1846:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (newwindowpath, "%s:%s", windowpath, nums); data/gdm3-3.38.2/daemon/gdm-server.c:438:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (identifier, prefix); data/gdm3-3.38.2/daemon/gdm-server.c:439:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (identifier, server->display_name); data/gdm3-3.38.2/daemon/gdm-session-worker.c:247:25: [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 (new_argv[0], new_argv); data/gdm3-3.38.2/daemon/gdm-session-worker.c:283:25: [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 (file, argv); data/gdm3-3.38.2/daemon/gdm-session-worker.c:341:33: [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 (startp, argv); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:779:14: [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. fd = popen (factory->willing_script, "r"); data/gdm3-3.38.2/daemon/gdm-display.c:1839:22: [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/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:275:26: [3] (random) g_random_int: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. serial = g_random_int (); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:3409:35: [3] (random) g_random_int: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. factory->session_serial = g_random_int (); data/gdm3-3.38.2/pam-extensions/gdm-pam-extensions.h:52:33: [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. _supported_extensions = getenv ("GDM_SUPPORTED_PAM_EXTENSIONS"); \ data/gdm3-3.38.2/pam-extensions/gdm-pam-extensions.h:107:33: [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. _supported_extensions = getenv ("GDM_SUPPORTED_PAM_EXTENSIONS"); \ data/gdm3-3.38.2/utils/gdmflexiserver.c:113:21: [3] (random) g_random_double: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. x = g_random_double (); data/gdm3-3.38.2/utils/gdmflexiserver.c:114:21: [3] (random) g_random_double: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. y = g_random_double (); data/gdm3-3.38.2/chooser/gdm-host-chooser-widget.c:523:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char serv_buf [NI_MAXSERV]; data/gdm3-3.38.2/common/gdm-address.c:114:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (addr->ss, sa, size); data/gdm3-3.38.2/common/gdm-address.c:256:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host [NI_MAXHOST]; data/gdm3-3.38.2/common/gdm-address.c:299:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host [NI_MAXHOST]; data/gdm3-3.38.2/common/gdm-address.c:300:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char serv [NI_MAXSERV]; data/gdm3-3.38.2/common/gdm-address.c:375:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ]; data/gdm3-3.38.2/common/gdm-address.c:426:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostbuf[BUFSIZ]; data/gdm3-3.38.2/common/gdm-common.c:292: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). fd = open ("/dev/urandom", O_RDONLY); data/gdm3-3.38.2/common/gdm-settings-utils.c:251:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char result[G_ASCII_DTOSTR_BUF_SIZE]; data/gdm3-3.38.2/daemon/gdm-display-access-file.c:444:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char localhost[HOST_NAME_MAX + 1] = ""; data/gdm3-3.38.2/daemon/gdm-display.c:1801:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nums[10]; data/gdm3-3.38.2/daemon/gdm-manager.c:1756:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). uid = (uid_t) atoi (gis_uid_contents); data/gdm3-3.38.2/daemon/gdm-server.c:477:34: [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). VE_IGNORE_EINTR (logfd = open (log_path, O_CREAT|O_APPEND|O_TRUNC|O_WRONLY|O_EXCL, 0644)); data/gdm3-3.38.2/daemon/gdm-session-linux-auditor.c:56:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/gdm3-3.38.2/daemon/gdm-session-worker.c:175: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 gdm_pam_extension_environment_block[_POSIX_ARG_MAX]; data/gdm3-3.38.2/daemon/gdm-session-worker.c:316:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (name + pathlen + 1, file, len); data/gdm3-3.38.2/daemon/gdm-session-worker.c:334:42: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. startp = memcpy (name - (p - path), path, p - path); data/gdm3-3.38.2/daemon/gdm-session-worker.c:876: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). fd = open ("/dev/tty0", O_RDWR | O_NOCTTY); data/gdm3-3.38.2/daemon/gdm-session-worker.c:886: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). fd = open ("/dev/tty0", O_RDWR | O_NOCTTY); data/gdm3-3.38.2/daemon/gdm-session-worker.c:965:28: [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). active_vt_tty_fd = open ("/dev/tty0", O_RDWR | O_NOCTTY); data/gdm3-3.38.2/daemon/gdm-session-worker.c:1092: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). fh = fopen (x11_authority_file, "r"); data/gdm3-3.38.2/daemon/gdm-session-worker.c:1104:17: [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 (retval->name, auth->name, auth->name_length); data/gdm3-3.38.2/daemon/gdm-session-worker.c:1107:17: [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 (retval->data, auth->data, auth->data_length); data/gdm3-3.38.2/daemon/gdm-session-worker.c:1129:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tty_string[256]; data/gdm3-3.38.2/daemon/gdm-session-worker.c:2033:36: [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). stdin_fd = open ("/dev/null", O_RDWR); data/gdm3-3.38.2/daemon/gdm-session-worker.c:2115:53: [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). stdout_fd = open ("/dev/null", O_RDWR); data/gdm3-3.38.2/daemon/gdm-session-worker.c:2120:45: [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). stdout_fd = open ("/dev/null", O_RDWR); data/gdm3-3.38.2/daemon/gdm-session-worker.c:2194:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char vt_string[256], tty_string[256]; data/gdm3-3.38.2/daemon/gdm-session-worker.c:2205:25: [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). initial_vt_fd = open (tty_string, O_RDWR | O_NOCTTY); data/gdm3-3.38.2/daemon/gdm-session-worker.c:2243:45: [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). worker->priv->session_tty_fd = open (tty_string, O_RDWR | O_NOCTTY); data/gdm3-3.38.2/daemon/gdm-session-worker.c:2260:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char vt_string[256]; data/gdm3-3.38.2/daemon/gdm-session-worker.c:2263: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). fd = open ("/dev/tty0", O_RDWR | O_NOCTTY); data/gdm3-3.38.2/daemon/gdm-x-session.c:117:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char localhost[HOST_NAME_MAX + 1] = ""; data/gdm3-3.38.2/daemon/gdm-x-session.c:237: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). vt = atoi (g_getenv ("XDG_VTNR")); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:447:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strport[NI_MAXSERV]; data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:492:41: [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 (hostaddr, ai->ai_addr, ai->ai_addrlen); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:759:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:1481:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host_buf [NI_MAXHOST]; data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:1482:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char serv_buf [NI_MAXSERV]; data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:1506:17: [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 (&port, req_port->data, 2); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:3404:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostbuf[1024]; data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:3415:17: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (hostbuf, "localhost.localdomain"); data/gdm3-3.38.2/daemon/main.c:120:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pid[9]; data/gdm3-3.38.2/daemon/main.c:123: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). pf = open (GDM_PID_FILE, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644); data/gdm3-3.38.2/daemon/test-session-client.c:67:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char answer[1024]; data/gdm3-3.38.2/daemon/test-session-client.c:115:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char answer[1024]; data/gdm3-3.38.2/chooser/gdm-host-chooser-widget.c:479:25: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ifreq.ifr_name, data/gdm3-3.38.2/common/gdm-common.c:238:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read (fd, ((guchar *) bytes) + total_bytes_read, data/gdm3-3.38.2/daemon/gdm-dbus-util.c:94: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). client_address += strlen("unix:path="); data/gdm3-3.38.2/daemon/gdm-display-access-file.c:455: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). *address_length = strlen (*address); data/gdm3-3.38.2/daemon/gdm-display-access-file.c:459: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). *number_length = strlen (*number); data/gdm3-3.38.2/daemon/gdm-display-access-file.c:462: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). *name_length = strlen (*name); data/gdm3-3.38.2/daemon/gdm-display.c:1806:65: [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). atom_cookie = xcb_intern_atom (priv->xcb_connection, 0, strlen("XFree86_VT"), "XFree86_VT"); data/gdm3-3.38.2/daemon/gdm-display.c:1845:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). newwindowpath = malloc (strlen (windowpath) + 1 + numn + 1); data/gdm3-3.38.2/daemon/gdm-display.c:1871: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). auth_info->namelen = strlen ("MIT-MAGIC-COOKIE-1"); data/gdm3-3.38.2/daemon/gdm-server.c:436: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). size = strlen (prefix) + strlen (server->display_name) + 1; data/gdm3-3.38.2/daemon/gdm-server.c:436: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). size = strlen (prefix) + strlen (server->display_name) + 1; data/gdm3-3.38.2/daemon/gdm-session-record.c:138:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). u->ut_syslen = MIN (strlen (hostname), sizeof (u->ut_host)); data/gdm3-3.38.2/daemon/gdm-session-record.c:158: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). display_device + strlen ("/dev/"), data/gdm3-3.38.2/daemon/gdm-session-worker.c:311: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). len = strlen (file) + 1; data/gdm3-3.38.2/daemon/gdm-session-worker.c:312: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). pathlen = strlen (path); data/gdm3-3.38.2/daemon/gdm-session-worker.c:732:44: [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). memset (user_answer, '\0', strlen (user_answer)); data/gdm3-3.38.2/daemon/gdm-session-worker.c:818:61: [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). memset (replies[i].resp, 0, strlen (replies[i].resp)); data/gdm3-3.38.2/daemon/gdm-session.c:598:62: [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 = g_strndup (base_name, strlen (base_name) - strlen (".desktop")); data/gdm3-3.38.2/daemon/gdm-session.c:598:83: [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 = g_strndup (base_name, strlen (base_name) - strlen (".desktop")); data/gdm3-3.38.2/daemon/gdm-session.c:896: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). (strlen (username)) ? username : "<unset>"); data/gdm3-3.38.2/daemon/gdm-session.c:898:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). gdm_session_select_user (self, (strlen (username) > 0) ? g_strdup (username) : NULL); data/gdm3-3.38.2/daemon/gdm-session.c:972: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 (strlen (language_name) > 0) { data/gdm3-3.38.2/daemon/gdm-x-session.c:128:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (localhost, "localhost", sizeof (localhost) - 1); data/gdm3-3.38.2/daemon/gdm-x-session.c:133:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). auth_entry.address_length = strlen (auth_entry.address); data/gdm3-3.38.2/daemon/gdm-x-session.c:135: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). auth_entry.name_length = strlen (auth_entry.name); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:544:33: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ifreq.ifr_name, ifr[i].ifr_name, sizeof (ifreq.ifr_name)); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:838: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). status.length = strlen ((char *) status.data); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:888: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). status.length = strlen ((char *) status.data); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:1962: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). status.length = strlen ((char *) status.data); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:2435:63: [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). authorization_name.length = strlen ((char *) authorization_name.data); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:2538: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). status.length = strlen ((char *) status.data); data/gdm3-3.38.2/daemon/gdm-xdmcp-display-factory.c:3427: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). factory->servhost.length = strlen ((char *) factory->servhost.data); data/gdm3-3.38.2/daemon/main.c:134: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). written = write (pf, pid, strlen (pid)); data/gdm3-3.38.2/daemon/test-session-client.c:78: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). answer[strlen (answer) - 1] = '\0'; data/gdm3-3.38.2/daemon/test-session-client.c:133: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). answer[strlen (answer) - 1] = '\0'; data/gdm3-3.38.2/libgdm/gdm-sessions.c:210:64: [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 *base_name = g_strndup (filename, strlen (filename) - strlen ("-xorg.desktop")); data/gdm3-3.38.2/libgdm/gdm-sessions.c:210:84: [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 *base_name = g_strndup (filename, strlen (filename) - strlen ("-xorg.desktop")); data/gdm3-3.38.2/libgdm/gdm-sessions.c:223: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). id = g_strndup (filename, strlen (filename) - strlen (".desktop")); data/gdm3-3.38.2/libgdm/gdm-sessions.c:223:63: [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). id = g_strndup (filename, strlen (filename) - strlen (".desktop")); data/gdm3-3.38.2/pam-extensions/gdm-pam-extensions.h:82: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). _size += strlen (_p); \ data/gdm3-3.38.2/pam-extensions/gdm-pam-extensions.h:84: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). size_t _next_chunk = strlen (supported_extensions[_t]) + strlen (" "); \ data/gdm3-3.38.2/pam-extensions/gdm-pam-extensions.h:84: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). size_t _next_chunk = strlen (supported_extensions[_t]) + strlen (" "); \ data/gdm3-3.38.2/pam_gdm/pam_gdm.c:50: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 (r < 0 || r != strlen (cached_password)) ANALYSIS SUMMARY: Hits = 108 Lines analyzed = 37381 in approximately 0.87 seconds (42984 lines/second) Physical Source Lines of Code (SLOC) = 27869 Hits@level = [0] 33 [1] 43 [2] 46 [3] 7 [4] 8 [5] 4 Hits@level+ = [0+] 141 [1+] 108 [2+] 65 [3+] 19 [4+] 12 [5+] 4 Hits/KSLOC@level+ = [0+] 5.05938 [1+] 3.87527 [2+] 2.33234 [3+] 0.681761 [4+] 0.430586 [5+] 0.143529 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.