[gupnp/wip/phako/reusable-service-action: 4/11] ServiceProxy: Prevent possible null pointer deref




commit 91dcb07fc400a0ef8f12586655de337299cd89e7
Author: Jens Georg <mail jensge org>
Date:   Sat May 29 01:38:46 2021 +0200

    ServiceProxy: Prevent possible null pointer deref
    
    If Proxy went down while soup message is still running, the weak
    reference will have nulled the pointer

 libgupnp/gupnp-service-proxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index db0e261..6a1729c 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -616,7 +616,7 @@ on_action_cancelled (GCancellable *cancellable, gpointer user_data)
         GUPnPContext *context;
         SoupSession *session;
 
-        if (action->msg != NULL) {
+        if (action->msg != NULL && action->proxy != NULL) {
                 context = gupnp_service_info_get_context
                                         (GUPNP_SERVICE_INFO (action->proxy));
                 session = gupnp_context_get_session (context);


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