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/lightdm-1.26.0/liblightdm-qt/QLightDM/greeter.h
Examining data/lightdm-1.26.0/liblightdm-qt/QLightDM/sessionsmodel.h
Examining data/lightdm-1.26.0/liblightdm-qt/QLightDM/usersmodel.h
Examining data/lightdm-1.26.0/liblightdm-qt/QLightDM/power.h
Examining data/lightdm-1.26.0/liblightdm-qt/power.cpp
Examining data/lightdm-1.26.0/liblightdm-qt/usersmodel.cpp
Examining data/lightdm-1.26.0/liblightdm-qt/greeter.cpp
Examining data/lightdm-1.26.0/liblightdm-qt/sessionsmodel.cpp
Examining data/lightdm-1.26.0/common/configuration.c
Examining data/lightdm-1.26.0/common/privileges.h
Examining data/lightdm-1.26.0/common/user-list.c
Examining data/lightdm-1.26.0/common/configuration.h
Examining data/lightdm-1.26.0/common/privileges.c
Examining data/lightdm-1.26.0/common/dmrc.c
Examining data/lightdm-1.26.0/common/dmrc.h
Examining data/lightdm-1.26.0/common/user-list.h
Examining data/lightdm-1.26.0/tests/src/test-guest-wrapper.c
Examining data/lightdm-1.26.0/tests/src/Xmir.c
Examining data/lightdm-1.26.0/tests/src/dbus-env.c
Examining data/lightdm-1.26.0/tests/src/plymouth.c
Examining data/lightdm-1.26.0/tests/src/test-script-hook.c
Examining data/lightdm-1.26.0/tests/src/test-gobject-greeter.c
Examining data/lightdm-1.26.0/tests/src/status.h
Examining data/lightdm-1.26.0/tests/src/x-common.c
Examining data/lightdm-1.26.0/tests/src/initctl.c
Examining data/lightdm-1.26.0/tests/src/Xvnc.c
Examining data/lightdm-1.26.0/tests/src/test-session.c
Examining data/lightdm-1.26.0/tests/src/x-server.c
Examining data/lightdm-1.26.0/tests/src/x-server.h
Examining data/lightdm-1.26.0/tests/src/xdmcp-client.c
Examining data/lightdm-1.26.0/tests/src/guest-account.c
Examining data/lightdm-1.26.0/tests/src/X.c
Examining data/lightdm-1.26.0/tests/src/libsystem.c
Examining data/lightdm-1.26.0/tests/src/unity-system-compositor.c
Examining data/lightdm-1.26.0/tests/src/test-runner.c
Examining data/lightdm-1.26.0/tests/src/x-authority.h
Examining data/lightdm-1.26.0/tests/src/xdmcp-client.h
Examining data/lightdm-1.26.0/tests/src/vnc-client.c
Examining data/lightdm-1.26.0/tests/src/x-authority.c
Examining data/lightdm-1.26.0/tests/src/test-qt-greeter.cpp
Examining data/lightdm-1.26.0/tests/src/test-greeter-wrapper.c
Examining data/lightdm-1.26.0/tests/src/test-qt-greeter.h
Examining data/lightdm-1.26.0/tests/src/x-common.h
Examining data/lightdm-1.26.0/tests/src/status.c
Examining data/lightdm-1.26.0/src/seat-local.h
Examining data/lightdm-1.26.0/src/display-server.h
Examining data/lightdm-1.26.0/src/greeter.c
Examining data/lightdm-1.26.0/src/login1.c
Examining data/lightdm-1.26.0/src/greeter-session.h
Examining data/lightdm-1.26.0/src/vnc-server.h
Examining data/lightdm-1.26.0/src/xdmcp-session.h
Examining data/lightdm-1.26.0/src/display-manager-service.c
Examining data/lightdm-1.26.0/src/session.c
Examining data/lightdm-1.26.0/src/session-config.c
Examining data/lightdm-1.26.0/src/console-kit.h
Examining data/lightdm-1.26.0/src/x-server-xvnc.h
Examining data/lightdm-1.26.0/src/greeter.h
Examining data/lightdm-1.26.0/src/plymouth.c
Examining data/lightdm-1.26.0/src/unity-system-compositor.h
Examining data/lightdm-1.26.0/src/x-server-xvnc.c
Examining data/lightdm-1.26.0/src/seat.h
Examining data/lightdm-1.26.0/src/display-manager.h
Examining data/lightdm-1.26.0/src/seat-xdmcp-session.h
Examining data/lightdm-1.26.0/src/display-server.c
Examining data/lightdm-1.26.0/src/vt.c
Examining data/lightdm-1.26.0/src/session-config.h
Examining data/lightdm-1.26.0/src/xdmcp-server.c
Examining data/lightdm-1.26.0/src/xdmcp-protocol.h
Examining data/lightdm-1.26.0/src/x-server.c
Examining data/lightdm-1.26.0/src/login1.h
Examining data/lightdm-1.26.0/src/logger.h
Examining data/lightdm-1.26.0/src/x-server.h
Examining data/lightdm-1.26.0/src/guest-account.c
Examining data/lightdm-1.26.0/src/x-server-remote.c
Examining data/lightdm-1.26.0/src/wayland-session.c
Examining data/lightdm-1.26.0/src/dm-tool.c
Examining data/lightdm-1.26.0/src/accounts.c
Examining data/lightdm-1.26.0/src/greeter-session.c
Examining data/lightdm-1.26.0/src/seat-xdmcp-session.c
Examining data/lightdm-1.26.0/src/seat-unity.h
Examining data/lightdm-1.26.0/src/unity-system-compositor.c
Examining data/lightdm-1.26.0/src/plymouth.h
Examining data/lightdm-1.26.0/src/display-manager-service.h
Examining data/lightdm-1.26.0/src/x-authority.h
Examining data/lightdm-1.26.0/src/x-server-remote.h
Examining data/lightdm-1.26.0/src/process.h
Examining data/lightdm-1.26.0/src/xdmcp-session.c
Examining data/lightdm-1.26.0/src/vt.h
Examining data/lightdm-1.26.0/src/lightdm-guest-session.c
Examining data/lightdm-1.26.0/src/x-authority.c
Examining data/lightdm-1.26.0/src/seat-unity.c
Examining data/lightdm-1.26.0/src/vnc-server.c
Examining data/lightdm-1.26.0/src/seat-xremote.c
Examining data/lightdm-1.26.0/src/xdmcp-server.h
Examining data/lightdm-1.26.0/src/session.h
Examining data/lightdm-1.26.0/src/accounts.h
Examining data/lightdm-1.26.0/src/seat-xvnc.c
Examining data/lightdm-1.26.0/src/log-file.h
Examining data/lightdm-1.26.0/src/shared-data-manager.h
Examining data/lightdm-1.26.0/src/log-file.c
Examining data/lightdm-1.26.0/src/seat-xremote.h
Examining data/lightdm-1.26.0/src/logger.c
Examining data/lightdm-1.26.0/src/x-server-xmir.c
Examining data/lightdm-1.26.0/src/x-server-xmir.h
Examining data/lightdm-1.26.0/src/xdmcp-protocol.c
Examining data/lightdm-1.26.0/src/guest-account.h
Examining data/lightdm-1.26.0/src/xdmcp-session-private.h
Examining data/lightdm-1.26.0/src/console-kit.c
Examining data/lightdm-1.26.0/src/x-server-local.h
Examining data/lightdm-1.26.0/src/greeter-socket.c
Examining data/lightdm-1.26.0/src/session-child.h
Examining data/lightdm-1.26.0/src/x-server-local.c
Examining data/lightdm-1.26.0/src/display-manager.c
Examining data/lightdm-1.26.0/src/seat-local.c
Examining data/lightdm-1.26.0/src/wayland-session.h
Examining data/lightdm-1.26.0/src/seat-xvnc.h
Examining data/lightdm-1.26.0/src/greeter-socket.h
Examining data/lightdm-1.26.0/src/seat.c
Examining data/lightdm-1.26.0/src/shared-data-manager.c
Examining data/lightdm-1.26.0/src/lightdm.c
Examining data/lightdm-1.26.0/src/process.c
Examining data/lightdm-1.26.0/src/session-child.c
Examining data/lightdm-1.26.0/liblightdm-gobject/user.c
Examining data/lightdm-1.26.0/liblightdm-gobject/greeter.c
Examining data/lightdm-1.26.0/liblightdm-gobject/session.c
Examining data/lightdm-1.26.0/liblightdm-gobject/language.c
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm.h
Examining data/lightdm-1.26.0/liblightdm-gobject/system.c
Examining data/lightdm-1.26.0/liblightdm-gobject/power.c
Examining data/lightdm-1.26.0/liblightdm-gobject/layout.c
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm/greeter.h
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm/system.h
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm/language.h
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm/layout.h
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm/user.h
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm/session.h
Examining data/lightdm-1.26.0/liblightdm-gobject/lightdm/power.h

FINAL RESULTS:

data/lightdm-1.26.0/src/greeter-socket.c:113:9:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if (chmod (socket->priv->path, S_IRWXU | S_IRWXG | S_IRWXO) < 0)
data/lightdm-1.26.0/src/session.c:756:17:  [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, user_get_uid (session_get_user (session)), user_get_gid (session_get_user (session))) < 0)
data/lightdm-1.26.0/src/session.c:783:17:  [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, user_get_uid (session_get_user (session)), user_get_gid (session_get_user (session))) < 0)
data/lightdm-1.26.0/tests/src/libsystem.c:387:1:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
chown (const char *pathname, uid_t owner, gid_t group)
data/lightdm-1.26.0/tests/src/libsystem.c:394:1:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
chmod (const char *path, mode_t mode)
data/lightdm-1.26.0/tests/src/test-runner.c:2541: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 (path, uid, gid) < 0)
data/lightdm-1.26.0/tests/src/test-runner.c:2654:17:  [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, users[i].uid, users[i].uid) < 0)
data/lightdm-1.26.0/tests/src/test-runner.c:2695:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
            chmod (path, S_IRUSR | S_IWUSR);
data/lightdm-1.26.0/src/logger.c:6:119:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
logger_logv_default (Logger *self, GLogLevelFlags log_level, const gchar *format, va_list ap) __attribute__ ((format (printf, 3, 0)));
data/lightdm-1.26.0/src/logger.h:47:116:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
void logger_logv (Logger *self, GLogLevelFlags log_level, const gchar *format, va_list ap) __attribute__ ((format (printf, 3, 0)));
data/lightdm-1.26.0/src/logger.h:50:108:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
void logger_log (Logger *self, GLogLevelFlags log_level, const gchar *format, ...) __attribute__ ((format (printf, 3, 4)));
data/lightdm-1.26.0/src/process.c:241:9:  [4] (shell) execvp:
  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.
        execvp (argv[0], argv);
data/lightdm-1.26.0/src/session.c:582:9:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        execlp ("lightdm",
data/lightdm-1.26.0/src/vt.c:43:12:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    return access ("/dev/tty0", F_OK) == 0 &&
data/lightdm-1.26.0/src/vt.c:44:12:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
           access ("/sys/class/tty/tty0/active", F_OK) == 0;
data/lightdm-1.26.0/tests/src/dbus-env.c:66:9:  [4] (shell) execvp:
  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.
        execvp (argv[1], argv + 1);
data/lightdm-1.26.0/tests/src/guest-account.c:95:13:  [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.
        if (system (command))
data/lightdm-1.26.0/tests/src/libsystem.c:301:1:  [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.
access (const char *pathname, int mode)
data/lightdm-1.26.0/tests/src/status.c:167:5:  [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 (status, 1024, format, ap);
data/lightdm-1.26.0/tests/src/status.h:14:70:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
void status_notify (const gchar *format, ...) __attribute__((format (printf, 1, 2)));
data/lightdm-1.26.0/tests/src/test-greeter-wrapper.c:19:5:  [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 (argv[1], argv + 1);
data/lightdm-1.26.0/tests/src/test-guest-wrapper.c:19:5:  [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 (argv[1], argv + 1);
data/lightdm-1.26.0/tests/src/test-runner.c:231:13:  [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.
        if (system (command))
data/lightdm-1.26.0/tests/src/test-runner.c:2498:13:  [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.
        if (system (g_strdup_printf ("cp %s %s/etc/lightdm/lightdm.conf", config_path, temp_dir)))
data/lightdm-1.26.0/tests/src/test-runner.c:2500:9:  [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.
    if (system (g_strdup_printf ("cp %s/tests/data/keys.conf %s/etc/lightdm/", SRCDIR, temp_dir)))
data/lightdm-1.26.0/tests/src/test-runner.c:2510:17:  [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.
            if (system (g_strdup_printf ("cp %s/tests/scripts/%s %s/usr/share/lightdm/lightdm.conf.d", SRCDIR, files[i], temp_dir)))
data/lightdm-1.26.0/tests/src/test-runner.c:2521:17:  [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.
            if (system (g_strdup_printf ("cp %s/tests/scripts/%s %s/etc/xdg/lightdm/lightdm.conf.d", SRCDIR, files[i], temp_dir)))
data/lightdm-1.26.0/tests/src/test-runner.c:2548:9:  [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.
    if (system (g_strdup_printf ("cp %s %s/script", config_path, temp_dir)))
data/lightdm-1.26.0/tests/src/test-runner.c:2552:9:  [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.
    if (system (g_strdup_printf ("cp %s/sessions/* %s/usr/share/lightdm/sessions", DATADIR, temp_dir)))
data/lightdm-1.26.0/tests/src/test-runner.c:2554:9:  [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.
    if (system (g_strdup_printf ("cp %s/remote-sessions/* %s/usr/share/lightdm/remote-sessions", DATADIR, temp_dir)))
data/lightdm-1.26.0/tests/src/test-runner.c:2556:9:  [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.
    if (system (g_strdup_printf ("cp %s/greeters/* %s/usr/share/lightdm/greeters", DATADIR, temp_dir)))
data/lightdm-1.26.0/src/lightdm.c:700:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv ("DISPLAY") && getuid () != 0)
data/lightdm-1.26.0/src/lightdm.c:855:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv ("DISPLAY"))
data/lightdm-1.26.0/src/x-authority.c:63:21:  [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.
        cookie[i] = g_random_int () & 0xFF;
data/lightdm-1.26.0/src/x-server-local.c:503:56:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
            g_autofree gchar *path = g_build_filename (g_get_home_dir (), ".Xauthority", NULL);
data/lightdm-1.26.0/src/xdmcp-server.c:158:14:  [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.
        id = g_random_int () & 0xFFFFFFFF;
data/lightdm-1.26.0/src/xdmcp-server.c:521:30:  [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.
            session_key[i] = g_random_int () & 0xFF;
data/lightdm-1.26.0/tests/src/libsystem.c:1630:19:  [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.
        display = getenv ("DISPLAY");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:413:28:  [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.
    const gchar *display = getenv ("DISPLAY");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:414:29:  [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.
    const gchar *xdg_seat = getenv ("XDG_SEAT");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:415:29:  [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.
    const gchar *xdg_vtnr = getenv ("XDG_VTNR");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:416:39:  [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.
    const gchar *xdg_session_cookie = getenv ("XDG_SESSION_COOKIE");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:417:38:  [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.
    const gchar *xdg_session_class = getenv ("XDG_SESSION_CLASS");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:418:37:  [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.
    const gchar *xdg_session_type = getenv ("XDG_SESSION_TYPE");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:419:43:  [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.
    const gchar *mir_server_host_socket = getenv ("MIR_SERVER_HOST_SOCKET");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:420:27:  [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.
    const gchar *mir_vt = getenv ("MIR_SERVER_VT");
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:421:27:  [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.
    const gchar *mir_id = getenv ("MIR_SERVER_NAME");
data/lightdm-1.26.0/tests/src/test-greeter-wrapper.c:11:28:  [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.
    const gchar *display = getenv ("DISPLAY");
data/lightdm-1.26.0/tests/src/test-guest-wrapper.c:11:28:  [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.
    const gchar *display = getenv ("DISPLAY");
data/lightdm-1.26.0/tests/src/test-qt-greeter.cpp:259: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.
    display = getenv ("DISPLAY");
data/lightdm-1.26.0/tests/src/test-qt-greeter.cpp:260:16:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    xdg_seat = getenv ("XDG_SEAT");
data/lightdm-1.26.0/tests/src/test-qt-greeter.cpp:261:16:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    xdg_vtnr = getenv ("XDG_VTNR");
data/lightdm-1.26.0/tests/src/test-qt-greeter.cpp:262:26:  [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.
    xdg_session_cookie = getenv ("XDG_SESSION_COOKIE");
data/lightdm-1.26.0/tests/src/test-qt-greeter.cpp:263:25:  [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.
    xdg_session_class = getenv ("XDG_SESSION_CLASS");
data/lightdm-1.26.0/tests/src/test-qt-greeter.cpp:298:47:  [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.
    config = new QSettings (g_build_filename (getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), QSettings::IniFormat);
data/lightdm-1.26.0/tests/src/test-runner.c:122:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv ("DEBUG"))
data/lightdm-1.26.0/tests/src/test-runner.c:135:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv ("DEBUG"))
data/lightdm-1.26.0/tests/src/test-runner.c:144:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv ("DEBUG"))
data/lightdm-1.26.0/tests/src/test-runner.c:188:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv ("DEBUG"))
data/lightdm-1.26.0/tests/src/test-runner.c:228:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (temp_dir && getenv ("DEBUG") == NULL)
data/lightdm-1.26.0/tests/src/test-runner.c:416:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        if (getenv ("DEBUG"))
data/lightdm-1.26.0/tests/src/test-runner.c:960:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv ("DEBUG"))
data/lightdm-1.26.0/tests/src/test-session.c:92:38:  [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.
                                     getenv ("XDG_SEAT_PATH"),
data/lightdm-1.26.0/tests/src/test-session.c:108:38:  [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.
                                     getenv ("XDG_SESSION_PATH"),
data/lightdm-1.26.0/tests/src/test-session.c:178:44:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
            xauthority = g_build_filename (g_get_home_dir (), ".Xauthority", NULL);
data/lightdm-1.26.0/tests/src/test-session.c:200:28:  [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.
        const gchar *dir = getenv ("XDG_GREETER_DATA_DIR");
data/lightdm-1.26.0/tests/src/test-session.c:221:28:  [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.
        const gchar *dir = getenv ("XDG_GREETER_DATA_DIR");
data/lightdm-1.26.0/tests/src/test-session.c:316:28:  [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.
    const gchar *display = getenv ("DISPLAY");
data/lightdm-1.26.0/tests/src/test-session.c:317:29:  [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.
    const gchar *xdg_seat = getenv ("XDG_SEAT");
data/lightdm-1.26.0/tests/src/test-session.c:318:29:  [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.
    const gchar *xdg_vtnr = getenv ("XDG_VTNR");
data/lightdm-1.26.0/tests/src/test-session.c:319:40:  [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.
    const gchar *xdg_current_desktop = getenv ("XDG_CURRENT_DESKTOP");
data/lightdm-1.26.0/tests/src/test-session.c:320:41:  [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.
    const gchar *xdg_greeter_data_dir = getenv ("XDG_GREETER_DATA_DIR");
data/lightdm-1.26.0/tests/src/test-session.c:321:39:  [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.
    const gchar *xdg_session_cookie = getenv ("XDG_SESSION_COOKIE");
data/lightdm-1.26.0/tests/src/test-session.c:322:38:  [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.
    const gchar *xdg_session_class = getenv ("XDG_SESSION_CLASS");
data/lightdm-1.26.0/tests/src/test-session.c:323:37:  [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.
    const gchar *xdg_session_type = getenv ("XDG_SESSION_TYPE");
data/lightdm-1.26.0/tests/src/test-session.c:324:40:  [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.
    const gchar *xdg_session_desktop = getenv ("XDG_SESSION_DESKTOP");
data/lightdm-1.26.0/tests/src/test-session.c:325:43:  [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.
    const gchar *mir_server_host_socket = getenv ("MIR_SERVER_HOST_SOCKET");
data/lightdm-1.26.0/tests/src/test-session.c:326:27:  [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.
    const gchar *mir_vt = getenv ("MIR_SERVER_VT");
data/lightdm-1.26.0/tests/src/test-session.c:327:27:  [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.
    const gchar *mir_id = getenv ("MIR_SERVER_NAME");
data/lightdm-1.26.0/tests/src/test-session.c:387:54:  [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.
    g_string_append_printf (status_text, " USER=%s", getenv ("USER"));
data/lightdm-1.26.0/liblightdm-gobject/greeter.c:403: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 (buffer + *offset, value, length);
data/lightdm-1.26.0/liblightdm-gobject/greeter.c:436: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 (value, message + *offset, length);
data/lightdm-1.26.0/liblightdm-gobject/greeter.c:480:58:  [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).
        priv->to_server_channel = g_io_channel_unix_new (atoi (to_server_fd));
data/lightdm-1.26.0/liblightdm-gobject/greeter.c:481:60:  [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).
        priv->from_server_channel = g_io_channel_unix_new (atoi (from_server_fd));
data/lightdm-1.26.0/liblightdm-gobject/greeter.c:1286:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        timeout = atoi (value);
data/lightdm-1.26.0/src/dm-tool.c:444:31:  [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).
        gint display_number = atoi (options[0]);
data/lightdm-1.26.0/src/greeter.c:284: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 (buffer + *offset, value, length);
data/lightdm-1.26.0/src/greeter.c:645:13:  [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 (response[i].resp, secrets[j], secret_length); // FIXME: Need to convert from UTF-8
data/lightdm-1.26.0/src/greeter.c:783: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 (value, greeter->priv->read_buffer + *offset, length);
data/lightdm-1.26.0/src/lightdm.c:723:22:  [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 *pid_file = fopen (pid_path, "w");
data/lightdm-1.26.0/src/log-file.c:45:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int log_fd = open (log_filename, open_flags, 0600);
data/lightdm-1.26.0/src/seat.c:177:20:  [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).
    return value ? atoi (value) : 0;
data/lightdm-1.26.0/src/session-child.c:255: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).
    int fd = open ("/dev/null", O_RDONLY);
data/lightdm-1.26.0/src/session-child.c:260: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).
    fd = open ("/dev/null", O_WRONLY);
data/lightdm-1.26.0/src/session-child.c:270:26:  [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).
    from_daemon_output = atoi (argv[2]);
data/lightdm-1.26.0/src/session-child.c:271: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).
    to_daemon_input = atoi (argv[3]);
data/lightdm-1.26.0/src/session-child.c:510:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        int fd = open ("/dev/null", O_WRONLY);
data/lightdm-1.26.0/src/unity-system-compositor.c:146: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 (data + 4, payload, payload_length);
data/lightdm-1.26.0/src/unity-system-compositor.c:326: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).
    int fd = open ("/dev/null", O_RDONLY);
data/lightdm-1.26.0/src/x-authority.c:96: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->priv->address, address, address_length);
data/lightdm-1.26.0/src/x-authority.c:150: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->priv->authorization_data, data, data_length);
data/lightdm-1.26.0/src/x-authority.c:167: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 (data, auth->priv->authorization_data, auth->priv->authorization_data_length);
data/lightdm-1.26.0/src/x-server-local.c:110:36:  [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).
    version_major = n_tokens > 0 ? atoi (tokens[0]) : 0;
data/lightdm-1.26.0/src/x-server-local.c:111:36:  [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).
    version_minor = n_tokens > 1 ? atoi (tokens[1]) : 0;
data/lightdm-1.26.0/src/x-server-local.c:145:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        int pid = atoi (g_strstrip (data));
data/lightdm-1.26.0/src/x-server-local.c:327: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).
    int fd = open ("/dev/null", O_RDONLY);
data/lightdm-1.26.0/src/xdmcp-server.c:453:13:  [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 (input, packet->Request.authentication_data.data, packet->Request.authentication_data.length);
data/lightdm-1.26.0/src/xdmcp-server.c:533: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 (session_authorization_data, rho.data, 8);
data/lightdm-1.26.0/src/xdmcp-server.c:534: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 (session_authorization_data + 8, session_key, 8);
data/lightdm-1.26.0/tests/src/X.c:148: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 (xdmcp_cookie, message->authorization_data, message->authorization_data_length);
data/lightdm-1.26.0/tests/src/X.c:250:38:  [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).
            request_display_number = atoi (text);
data/lightdm-1.26.0/tests/src/X.c:303:26:  [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).
            session_id = atoi (text);
data/lightdm-1.26.0/tests/src/X.c:308:37:  [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).
            manage_display_number = atoi (text);
data/lightdm-1.26.0/tests/src/X.c:325:41:  [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).
            keep_alive_display_number = atoi (text);
data/lightdm-1.26.0/tests/src/X.c:330:26:  [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).
            session_id = atoi (text);
data/lightdm-1.26.0/tests/src/X.c:365:55:  [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).
    xorg_version_major = g_strv_length (tokens) > 0 ? atoi (tokens[0]) : 0;
data/lightdm-1.26.0/tests/src/X.c:366:55:  [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).
    xorg_version_minor = g_strv_length (tokens) > 1 ? atoi (tokens[1]) : 0;
data/lightdm-1.26.0/tests/src/X.c:382:30:  [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).
            display_number = atoi (arg + 1);
data/lightdm-1.26.0/tests/src/X.c:427:26:  [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).
            xdmcp_port = atoi (argv[i+1]);
data/lightdm-1.26.0/tests/src/X.c:444:25:  [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_number = atoi (arg + 2);
data/lightdm-1.26.0/tests/src/X.c:534:21:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444);
data/lightdm-1.26.0/tests/src/X.c:544:19:  [2] (integer) atol:
  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).
            pid = atol (lock_contents);
data/lightdm-1.26.0/tests/src/X.c:564: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).
            lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444);
data/lightdm-1.26.0/tests/src/Xmir.c:134:30:  [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).
            display_number = atoi (arg + 1);
data/lightdm-1.26.0/tests/src/Xmir.c:160:25:  [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_number = atoi (arg + 2);
data/lightdm-1.26.0/tests/src/Xmir.c:228:21:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444);
data/lightdm-1.26.0/tests/src/Xmir.c:234:25:  [2] (integer) atol:
  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).
            pid_t pid = atol (lock_contents);
data/lightdm-1.26.0/tests/src/Xmir.c:250: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).
            lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444);
data/lightdm-1.26.0/tests/src/Xvnc.c:160:30:  [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).
            display_number = atoi (arg + 1);
data/lightdm-1.26.0/tests/src/Xvnc.c:183:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            depth = atoi (argv[i+1]);
data/lightdm-1.26.0/tests/src/Xvnc.c:234:21:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444);
data/lightdm-1.26.0/tests/src/Xvnc.c:240:25:  [2] (integer) atol:
  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).
            pid_t pid = atol (lock_contents);
data/lightdm-1.26.0/tests/src/Xvnc.c:256: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).
            lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444);
data/lightdm-1.26.0/tests/src/guest-account.c:39:24:  [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 *passwd = fopen (passwd_path, "r");
data/lightdm-1.26.0/tests/src/guest-account.c:48:32:  [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).
                    gint uid = atoi (tokens[2]);
data/lightdm-1.26.0/tests/src/guest-account.c:57:18:  [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).
        passwd = fopen (passwd_path, "a");
data/lightdm-1.26.0/tests/src/guest-account.c:75:24:  [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 *passwd = fopen (passwd_path, "r");
data/lightdm-1.26.0/tests/src/guest-account.c:77:28:  [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 *new_passwd = fopen (path, "w");
data/lightdm-1.26.0/tests/src/libsystem.c:124: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).
            list[i] = atoi (groups[i]);
data/lightdm-1.26.0/tests/src/libsystem.c:237:1:  [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 (const char *pathname, int flags, ...)
data/lightdm-1.26.0/tests/src/libsystem.c:265:1:  [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).
fopen (const char *path, const char *mode)
data/lightdm-1.26.0/tests/src/libsystem.c:488:13:  [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 (&temp_addr_un, addr, sizeof (struct sockaddr_un));
data/lightdm-1.26.0/tests/src/libsystem.c:496: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 (&temp_addr_in, addr, sizeof (struct sockaddr_in));
data/lightdm-1.26.0/tests/src/libsystem.c:506: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 (&temp_addr_in6, addr, sizeof (struct sockaddr_in6));
data/lightdm-1.26.0/tests/src/libsystem.c:563:13:  [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 (&temp_addr_un, addr, addrlen);
data/lightdm-1.26.0/tests/src/libsystem.c:573:13:  [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 (&temp_addr_in, addr, sizeof (struct sockaddr_in));
data/lightdm-1.26.0/tests/src/libsystem.c:583:13:  [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 (&temp_addr_in6, addr, sizeof (struct sockaddr_in6));
data/lightdm-1.26.0/tests/src/libsystem.c:611:13:  [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 (&temp_addr_un, dest_addr, sizeof (struct sockaddr_un));
data/lightdm-1.26.0/tests/src/libsystem.c:621:13:  [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 (&temp_addr_in, dest_addr, sizeof (struct sockaddr_in));
data/lightdm-1.26.0/tests/src/libsystem.c:631:13:  [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 (&temp_addr_in6, dest_addr, sizeof (struct sockaddr_in6));
data/lightdm-1.26.0/tests/src/libsystem.c:693:29:  [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).
            entry->pw_uid = atoi (fields[2]);
data/lightdm-1.26.0/tests/src/libsystem.c:694:29:  [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).
            entry->pw_gid = atoi (fields[3]);
data/lightdm-1.26.0/tests/src/libsystem.c:803:29:  [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).
            entry->gr_gid = atoi (fields[2]);
data/lightdm-1.26.0/tests/src/test-gobject-greeter.c:139: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 (!(f = fopen (path, "w")) || fprintf (f, "%s", test_data) < 0)
data/lightdm-1.26.0/tests/src/test-runner.c:452:28:  [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 duration = v ? atoi (v) : 1;
data/lightdm-1.26.0/tests/src/test-runner.c:480:93:  [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).
                                                                  g_variant_new ("(i)", v ? atoi (v) : -1),
data/lightdm-1.26.0/tests/src/test-runner.c:2148:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        guint uid = atoi (fields[2]);
data/lightdm-1.26.0/tests/src/test-script-hook.c:34:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        return atoi (argv[2]);
data/lightdm-1.26.0/tests/src/test-session.c:207:23:  [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 (!(f = fopen (path, "w")) || fprintf (f, "%s", data) < 0)
data/lightdm-1.26.0/tests/src/unity-system-compositor.c:59: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 (data + 4, payload, payload_length);
data/lightdm-1.26.0/tests/src/unity-system-compositor.c:161:26:  [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).
            from_dm_fd = atoi (argv[i+1]);
data/lightdm-1.26.0/tests/src/unity-system-compositor.c:166:24:  [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).
            to_dm_fd = atoi (argv[i+1]);
data/lightdm-1.26.0/tests/src/unity-system-compositor.c:171:25:  [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_number = atoi (argv[i+1]);
data/lightdm-1.26.0/liblightdm-gobject/greeter.c:393: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).
        length = strlen (value);
data/lightdm-1.26.0/liblightdm-gobject/greeter.c:447: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).
        return int_length () + strlen (value);
data/lightdm-1.26.0/liblightdm-gobject/language.c:221: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).
            if (language_en && strlen (language_en) > 0)
data/lightdm-1.26.0/liblightdm-gobject/language.c:261: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).
            if (country_en && strlen (country_en) > 0 && g_strcmp0 (country_en, "ISO") != 0)
data/lightdm-1.26.0/liblightdm-gobject/session.c:148:58:  [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).
            g_autofree gchar *key = g_strndup (filename, strlen (filename) - strlen (".desktop"));
data/lightdm-1.26.0/liblightdm-gobject/session.c:148:78:  [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).
            g_autofree gchar *key = g_strndup (filename, strlen (filename) - strlen (".desktop"));
data/lightdm-1.26.0/liblightdm-gobject/system.c:75: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).
            size_t value_length = strlen (value);
data/lightdm-1.26.0/src/dm-tool.c:293: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).
                seat_name = seat_path + strlen ("/org/freedesktop/DisplayManager/");
data/lightdm-1.26.0/src/dm-tool.c:330: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).
                    session_name = session_path + strlen ("/org/freedesktop/DisplayManager/");
data/lightdm-1.26.0/src/greeter.c:276: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).
        length = strlen (value);
data/lightdm-1.26.0/src/greeter.c:302: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).
        return int_length () + strlen (value);
data/lightdm-1.26.0/src/greeter.c:643: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).
            size_t secret_length = strlen (secrets[j]) + 1;
data/lightdm-1.26.0/src/lightdm.c:89:50:  [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).
        ssize_t n_written = write (log_fd, text, strlen (text));
data/lightdm-1.26.0/src/lightdm.c:129: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).
            const gchar *seat_name_glob = *i + strlen ("Seat:");
data/lightdm-1.26.0/src/process.c:391:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read (signal_pipe[0], &signo, sizeof (int)) != sizeof (int) ||
data/lightdm-1.26.0/src/process.c:392:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        read (signal_pipe[0], &pid, sizeof (pid_t)) != sizeof (pid_t))
data/lightdm-1.26.0/src/session-child.c:59: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).
    int length = value ? strlen (value) : -1;
data/lightdm-1.26.0/src/session-child.c:68:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t n_read = read (from_daemon_output, buf, count);
data/lightdm-1.26.0/src/session-child.c:204:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (u.ut_line, ut->ut_line, sizeof (u.ut_line));
data/lightdm-1.26.0/src/session-child.c:206:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (u.ut_id, ut->ut_id, sizeof (u.ut_id));
data/lightdm-1.26.0/src/session-child.c:208:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (u.ut_user, ut->ut_user, sizeof (u.ut_user));
data/lightdm-1.26.0/src/session-child.c:210:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (u.ut_host, ut->ut_host, sizeof (u.ut_host));
data/lightdm-1.26.0/src/session-child.c:320: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).
        value.namelen = strlen (x_authority_get_authorization_name (x_authority));
data/lightdm-1.26.0/src/session-child.c:354:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_id, xdisplay, sizeof (ut.ut_id));
data/lightdm-1.26.0/src/session-child.c:356:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
data/lightdm-1.26.0/src/session-child.c:356: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).
                strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
data/lightdm-1.26.0/src/session-child.c:357:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy (ut.ut_user, username, sizeof (ut.ut_user));
data/lightdm-1.26.0/src/session-child.c:359:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_host, xdisplay, sizeof (ut.ut_host));
data/lightdm-1.26.0/src/session-child.c:361:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_host, remote_host_name, sizeof (ut.ut_host));
data/lightdm-1.26.0/src/session-child.c:699:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_id, xdisplay, sizeof (ut.ut_id));
data/lightdm-1.26.0/src/session-child.c:701:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
data/lightdm-1.26.0/src/session-child.c:701: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).
                strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
data/lightdm-1.26.0/src/session-child.c:702:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy (ut.ut_user, username, sizeof (ut.ut_user));
data/lightdm-1.26.0/src/session-child.c:704:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_host, xdisplay, sizeof (ut.ut_host));
data/lightdm-1.26.0/src/session-child.c:706:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_host, remote_host_name, sizeof (ut.ut_host));
data/lightdm-1.26.0/src/session-child.c:740:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_id, xdisplay, sizeof (ut.ut_id));
data/lightdm-1.26.0/src/session-child.c:742:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
data/lightdm-1.26.0/src/session-child.c:742: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).
                strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
data/lightdm-1.26.0/src/session-child.c:743:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy (ut.ut_user, username, sizeof (ut.ut_user));
data/lightdm-1.26.0/src/session-child.c:745:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_host, xdisplay, sizeof (ut.ut_host));
data/lightdm-1.26.0/src/session-child.c:747:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy (ut.ut_host, remote_host_name, sizeof (ut.ut_host));
data/lightdm-1.26.0/src/session.c:278:53:  [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 (g_str_has_prefix (entry, name) && entry[strlen (name)] == '=')
data/lightdm-1.26.0/src/session.c:312: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).
    return entry + strlen (name) + 1;
data/lightdm-1.26.0/src/session.c:359: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).
    int length = value ? strlen (value) : -1;
data/lightdm-1.26.0/src/session.c:389:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t n_read = read (session->priv->from_child_output, buf, count);
data/lightdm-1.26.0/src/unity-system-compositor.c:157:85:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    write_message (compositor, USC_MESSAGE_SET_ACTIVE_SESSION, (const guint8 *) id, strlen (id));
data/lightdm-1.26.0/src/unity-system-compositor.c:164: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).
    write_message (compositor, USC_MESSAGE_SET_NEXT_SESSION, (const guint8 *) id, strlen (id));
data/lightdm-1.26.0/src/x-authority.c:73:77:  [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).
    return x_authority_new_cookie (XAUTH_FAMILY_LOCAL, (guint8 *) hostname, strlen (hostname), number);
data/lightdm-1.26.0/src/x-authority.c:235: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).
    size_t value_length = strlen (value);
data/lightdm-1.26.0/src/x-server-local.c:88: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).
    return g_strdup (line + strlen (XORG_VERSION_PREFIX));
data/lightdm-1.26.0/src/x-server.c:113: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).
        a.namelen = strlen (x_authority_get_authorization_name (server->priv->authority));
data/lightdm-1.26.0/src/xdmcp-protocol.c:136: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).
    write_card16 (writer, strlen (value));
data/lightdm-1.26.0/src/xdmcp-server.c:562:53:  [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 (hostname),
data/lightdm-1.26.0/tests/src/X.c:280: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).
        gsize authentication_data_length = strlen (authentication_data_text) / 2;
data/lightdm-1.26.0/tests/src/X.c:578:39:  [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 (write (lock_file, pid_string, strlen (pid_string)) < 0)
data/lightdm-1.26.0/tests/src/Xmir.c:264:39:  [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 (write (lock_file, pid_string, strlen (pid_string)) < 0)
data/lightdm-1.26.0/tests/src/Xvnc.c:270:39:  [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 (write (lock_file, pid_string, strlen (pid_string)) < 0)
data/lightdm-1.26.0/tests/src/dbus-env.c:36:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t n_read = read (name_pipe[0], address, 1023);
data/lightdm-1.26.0/tests/src/libsystem.c:189:80:  [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).
        return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "etc", path + strlen (SYSCONFDIR), NULL);
data/lightdm-1.26.0/tests/src/libsystem.c:192:80:  [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).
        return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "var", path + strlen (LOCALSTATEDIR), NULL);
data/lightdm-1.26.0/tests/src/libsystem.c:195:89:  [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).
        return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "usr", "share", path + strlen (DATADIR), NULL);
data/lightdm-1.26.0/tests/src/libsystem.c:202:80:  [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).
        return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "tmp", path + strlen ("/tmp"), NULL);
data/lightdm-1.26.0/tests/src/libsystem.c:205:80:  [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).
        return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "run", path + strlen ("/run"), NULL);
data/lightdm-1.26.0/tests/src/libsystem.c:208:87:  [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).
        return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "etc", "xdg", path + strlen ("/etc/xdg"), NULL);
data/lightdm-1.26.0/tests/src/libsystem.c:211:100:  [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).
        return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "usr", "share", "lightdm", path + strlen ("/usr/share/lightdm"), NULL);
data/lightdm-1.26.0/tests/src/libsystem.c:489:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy (temp_addr_un.sun_path, new_path, sizeof (temp_addr_un.sun_path) - 1);
data/lightdm-1.26.0/tests/src/libsystem.c:564:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy (temp_addr_un.sun_path, new_path, sizeof (temp_addr_un.sun_path) - 1);
data/lightdm-1.26.0/tests/src/libsystem.c:612:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy (temp_addr_un.sun_path, new_path, sizeof (temp_addr_un.sun_path) - 1);
data/lightdm-1.26.0/tests/src/status.c:172: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).
        int length = strlen (status);
data/lightdm-1.26.0/tests/src/status.c:175: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).
            g_socket_send (status_socket, status, strlen (status), NULL, &error) < 0)
data/lightdm-1.26.0/tests/src/test-runner.c:906: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).
            int length = strlen (command);
data/lightdm-1.26.0/tests/src/test-runner.c:908:57:  [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).
                g_socket_send (client->socket, command, strlen (command), NULL, &error) < 0)
data/lightdm-1.26.0/tests/src/test-session.c:352: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).
        open_fds->str[strlen (open_fds->str) - 1] = '\0';
data/lightdm-1.26.0/tests/src/vnc-client.c:58:52:  [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).
    gssize n_sent = g_socket_send (socket, buffer, strlen (buffer), NULL, &error);
data/lightdm-1.26.0/tests/src/vnc-client.c:59: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).
    if (n_sent != strlen (buffer))
data/lightdm-1.26.0/tests/src/x-common.c:137: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).
    return (strlen (value) + pad (strlen (value))) / 4;
data/lightdm-1.26.0/tests/src/x-common.c:137: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).
    return (strlen (value) + pad (strlen (value))) / 4;
data/lightdm-1.26.0/tests/src/x-common.c:143: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).
    write_string8 (buffer, buffer_length, (guint8 *) value, strlen (value), offset);
data/lightdm-1.26.0/tests/src/x-common.c:149: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).
    write_string8 (buffer, buffer_length, (guint8 *) value, strlen (value), offset);
data/lightdm-1.26.0/tests/src/x-common.c:150: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).
    write_padding (buffer, buffer_length, pad (strlen (value)), offset);
data/lightdm-1.26.0/tests/src/x-server.c:57: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 (send (g_io_channel_unix_get_fd (client->priv->channel), message, strlen (message), 0) != strlen (message))
data/lightdm-1.26.0/tests/src/x-server.c:57:98:  [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 (send (g_io_channel_unix_get_fd (client->priv->channel), message, strlen (message), 0) != strlen (message))
data/lightdm-1.26.0/tests/src/x-server.c:66: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 (send (g_io_channel_unix_get_fd (client->priv->channel), message, strlen (message), 0) != strlen (message))
data/lightdm-1.26.0/tests/src/x-server.c:66:98:  [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 (send (g_io_channel_unix_get_fd (client->priv->channel), message, strlen (message), 0) != strlen (message))
data/lightdm-1.26.0/tests/src/xdmcp-client.c:332: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).
        length += 2 + strlen (*name);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:342:73:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        write_card16 (buffer, MAXIMUM_REQUEST_LENGTH, X_BYTE_ORDER_MSB, strlen (*name), &offset);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:374: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).
    gsize length = 11 + strlen (authentication_name) + authentication_data_length + strlen (mfid);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:374:85:  [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).
    gsize length = 11 + strlen (authentication_name) + authentication_data_length + strlen (mfid);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:385: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).
        length += 2 + strlen (*name);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:408:69:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    write_card16 (buffer, MAXIMUM_REQUEST_LENGTH, X_BYTE_ORDER_MSB, strlen (authentication_name), &offset);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:415:73:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        write_card16 (buffer, MAXIMUM_REQUEST_LENGTH, X_BYTE_ORDER_MSB, strlen (*name), &offset);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:418:69:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    write_card16 (buffer, MAXIMUM_REQUEST_LENGTH, X_BYTE_ORDER_MSB, strlen (mfid), &offset);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:432:73:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    write_card16 (buffer, MAXIMUM_REQUEST_LENGTH, X_BYTE_ORDER_MSB, 8 + strlen (display_class), &offset);
data/lightdm-1.26.0/tests/src/xdmcp-client.c:436:69:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    write_card16 (buffer, MAXIMUM_REQUEST_LENGTH, X_BYTE_ORDER_MSB, strlen (display_class), &offset);

ANALYSIS SUMMARY:

Hits = 257
Lines analyzed = 35497 in approximately 0.95 seconds (37437 lines/second)
Physical Source Lines of Code (SLOC) = 26913
Hits@level = [0]  15 [1]  94 [2]  83 [3]  49 [4]  23 [5]   8
Hits@level+ = [0+] 272 [1+] 257 [2+] 163 [3+]  80 [4+]  31 [5+]   8
Hits/KSLOC@level+ = [0+] 10.1066 [1+] 9.54929 [2+] 6.05655 [3+] 2.97254 [4+] 1.15186 [5+] 0.297254
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.