[gdm] session: Crash better when no sessions are installed



commit f42ea43dbd97f162d0b6ab59b70812a8b240c7d6
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue Jan 12 12:34:04 2016 -0600

    session: Crash better when no sessions are installed
    
    If no session desktop file can be found in the search path, we are
    doomed. Crash nicely with g_error rather than continuing on to call
    g_sequence_get with an invalid GSequenceIter.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760548

 daemon/gdm-session.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index dc3b497..4765a6b 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -564,6 +564,10 @@ get_fallback_session_name (GdmSession *self)
 
         name = NULL;
         session = g_sequence_get_begin_iter (sessions);
+
+        if (g_sequence_iter_is_end (session))
+                g_error ("GdmSession: no session desktop files installed, aborting...");
+
         do {
                if (g_sequence_get (session)) {
                        char *base_name;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]