summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2012-09-18 22:03:52 +0200
committerRay Strode <rstrode@redhat.com>2012-09-18 17:18:39 -0400
commit013a7693d3ca4a2241ba75d4e779b4c582a101c9 (patch)
treec3d3060e9ee34da4d6f7a3a7df6a7f9bb0b0f1cf /daemon
parent49f0485d5d2a0550da0eb367044ccf0211cadda4 (diff)
downloadgdm-013a7693d3ca4a2241ba75d4e779b4c582a101c9.tar.gz
GdmSession: check conversation before accessing it
Due to the way methods are handled by GDBus, it's possible we get a method invocation after the worker has already exited and the conversation freed. https://bugzilla.gnome.org/show_bug.cgi?id=684326
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-session.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 22da76ae..9a134ff2 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -672,11 +672,13 @@ gdm_session_handle_info_query (GdmDBusWorkerManager *worker_manager_interface,
g_return_val_if_fail (self->priv->user_verifier_interface != NULL, FALSE);
conversation = find_conversation_by_name (self, service_name);
- set_pending_query (conversation, invocation);
+ if (conversation != NULL) {
+ set_pending_query (conversation, invocation);
- gdm_dbus_user_verifier_emit_info_query (self->priv->user_verifier_interface,
- service_name,
- query);
+ gdm_dbus_user_verifier_emit_info_query (self->priv->user_verifier_interface,
+ service_name,
+ query);
+ }
return TRUE;
}
@@ -693,11 +695,13 @@ gdm_session_handle_secret_info_query (GdmDBusWorkerManager *worker_manager_inte
g_return_val_if_fail (self->priv->user_verifier_interface != NULL, FALSE);
conversation = find_conversation_by_name (self, service_name);
- set_pending_query (conversation, invocation);
+ if (conversation != NULL) {
+ set_pending_query (conversation, invocation);
- gdm_dbus_user_verifier_emit_secret_info_query (self->priv->user_verifier_interface,
- service_name,
- query);
+ gdm_dbus_user_verifier_emit_secret_info_query (self->priv->user_verifier_interface,
+ service_name,
+ query);
+ }
return TRUE;
}
@@ -2328,9 +2332,11 @@ gdm_session_open_session (GdmSession *self,
conversation = find_conversation_by_name (self, service_name);
- gdm_dbus_worker_call_open (conversation->worker_proxy,
- NULL,
- (GAsyncReadyCallback) on_opened, conversation);
+ if (conversation != NULL) {
+ gdm_dbus_worker_call_open (conversation->worker_proxy,
+ NULL,
+ (GAsyncReadyCallback) on_opened, conversation);
+ }
}
static void
@@ -2538,7 +2544,9 @@ gdm_session_answer_query (GdmSession *self,
conversation = find_conversation_by_name (self, service_name);
- answer_pending_query (conversation, text);
+ if (conversation != NULL) {
+ answer_pending_query (conversation, text);
+ }
}
void