summaryrefslogtreecommitdiff
blob: 165be019fc59ec072ceaf3f4f438f9eff5ff6a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Romain Perier <mrpouet@gentoo.org>
Date: Wed, 28 Oct 2009 17:20:04 +0100
Subject: Avoid a SIGSEGV in xsmp_stop() when the SmsConn object is NULL, in this case we must throw an GError (imported from 2.28 dev cycle)

When xsmp->priv->conn is NULL in xsmp_end_session() for a given GsmXsmpClient object, it implies
that this same object in xsmp_stop() will also have a NULL SmsConn field.

---
 gnome-session/gsm-xsmp-client.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

--- a/gnome-session/gsm-xsmp-client.c
+++ b/gnome-session/gsm-xsmp-client.c
@@ -702,6 +702,13 @@ xsmp_stop (GsmClient *client,
 
         g_debug ("GsmXSMPClient: xsmp_stop ('%s')", xsmp->priv->description);
 
+        if (xsmp->priv->conn == NULL) {
+                g_set_error (error,
+                             GSM_CLIENT_ERROR,
+                             GSM_CLIENT_ERROR_NOT_REGISTERED,
+                             "Client is not registered");
+                return FALSE;
+        }
         SmsDie (xsmp->priv->conn);
 
         return TRUE;