[gupnp] Avoid a crash in GUPnPServiceProxy::subscription_expire()
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp] Avoid a crash in GUPnPServiceProxy::subscription_expire()
- Date: Tue, 13 Feb 2018 20:12:21 +0000 (UTC)
commit c95f5d1fbdd0151abcec55c58b94c90cbf54540a
Author: Sven Neumann <neumann teufel de>
Date: Thu Mar 30 09:51:17 2017 +0200
Avoid a crash in GUPnPServiceProxy::subscription_expire()
Can't explain why, but we are seeing crashes in subscription_expire()
that seem to be caused by an attempt to renew the subscription even
though the SID is not set, leading to a crash in
soup_message_headers_append().
Add an extra check in subscription_expire() and also make sure
that the subscription timeout is removed before a new timeout is
installed in subscription_response().
https://bugzilla.gnome.org/show_bug.cgi?id=780715
Signed-off-by: Sven Neumann <neumann teufel de>
libgupnp/gupnp-service-proxy.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index c0f7779..5c3c318 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -2038,6 +2038,8 @@ subscription_expire (gpointer user_data)
/* Reset timeout ID */
proxy->priv->subscription_timeout_src = NULL;
+ g_return_val_if_fail (proxy->priv->sid != NULL, FALSE);
+
/* Send renewal message */
context = gupnp_service_info_get_context (GUPNP_SERVICE_INFO (proxy));
@@ -2095,6 +2097,12 @@ subscribe_got_response (G_GNUC_UNUSED SoupSession *session,
proxy->priv->pending_messages =
g_list_remove (proxy->priv->pending_messages, msg);
+ /* Remove subscription timeout */
+ if (proxy->priv->subscription_timeout_src) {
+ g_source_destroy (proxy->priv->subscription_timeout_src);
+ proxy->priv->subscription_timeout_src = NULL;
+ }
+
/* Check whether the subscription is still wanted */
if (!proxy->priv->subscribed)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]