summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2012-02-09 13:27:11 -0500
committerRay Strode <rstrode@redhat.com>2012-02-09 13:27:11 -0500
commit4c80969a0f8667d9a17ae44281cacb939e9f1a21 (patch)
tree1ae307628af161cc592a6adbf933ea88f8f42d9e /daemon
parent58917de5cb072208b0adb4f5a63590d5c957bb67 (diff)
downloadgdm-4c80969a0f8667d9a17ae44281cacb939e9f1a21.tar.gz
slave: fix crasher in systemd integration
sd_seat_get_sessions returns NULL instead of a one element array in the case there are no sessions associated with a seat. This commit guards against that problem.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-slave.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
index 371b9bdc..d864a3da 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -1336,6 +1336,11 @@ gdm_slave_get_primary_session_id_for_user_from_systemd (GdmSlave *slave,
return NULL;
}
+ if (sessions == NULL) {
+ g_debug ("GdmSlave: seat has no active sessions");
+ return NULL;
+ }
+
for (i = 0; sessions[i] != NULL; i++) {
if (primary_ssid == NULL) {