summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-01-09 16:05:36 +0100
committerJens Georg <mail@jensge.org>2022-01-09 16:14:19 +0100
commitc7d3e422c8547d39e0c08ae4ce95b55d3109a646 (patch)
tree67427a0212274a02f33b5cf71a4cb853e85fb7fe
parentaacf39ed865700d6be7c5320b5b08e11c3feec41 (diff)
downloadgupnp-c7d3e422c8547d39e0c08ae4ce95b55d3109a646.tar.gz
ControlPoint: Don't load description on url error
If the URL rewrite fails, don't try to load the description file
-rw-r--r--libgupnp/gupnp-control-point.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libgupnp/gupnp-control-point.c b/libgupnp/gupnp-control-point.c
index 71704b0..c6e12af 100644
--- a/libgupnp/gupnp-control-point.c
+++ b/libgupnp/gupnp-control-point.c
@@ -724,6 +724,15 @@ load_description (GUPnPControlPoint *control_point,
data->timeout = timeout;
local_description = gupnp_context_rewrite_uri (context,
description_url);
+ if (local_description == NULL) {
+ g_warning ("Invalid description URL: %s",
+ description_url);
+
+ g_slice_free (GetDescriptionURLData, data);
+
+ return;
+ }
+
data->message = soup_message_new (SOUP_METHOD_GET,
local_description);
g_free (local_description);