summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2020-06-17 13:47:56 +0200
committerJens Georg <mail@jensge.org>2020-06-17 13:49:09 +0200
commit30456fb402c5a062cddb47aa9edc0e02722e0982 (patch)
treecfd10257b2cfccd0e1eb4cc33993196839d8aa38
parentf943904e2d7f21601337b90058faf74b49c02796 (diff)
downloadgupnp-30456fb402c5a062cddb47aa9edc0e02722e0982.tar.gz
service: Style fixes
-rw-r--r--libgupnp/gupnp-context.c4
-rw-r--r--libgupnp/gupnp-service.c13
2 files changed, 8 insertions, 9 deletions
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index 513edc4..460179e 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -1702,8 +1702,8 @@ gupnp_context_ip_is_ours (GUPnPContext *context, const char *address)
// Link-local addresses are reachable
if (g_inet_address_get_is_link_local (addr)) {
- retval = TRUE;
- goto out;
+ retval = TRUE;
+ goto out;
}
mask = gssdp_client_get_address_mask (GSSDP_CLIENT (context));
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index e6664d5..812f548 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -1240,20 +1240,19 @@ subscribe (GUPnPService *service,
if (!end || !*end)
break;
- if (strncmp (start, "http://", strlen ("http://")) == 0) {
- *end = '\0';
- g_debug ("Subscription callback: >%s< >%s<", start, g_strndup (start, end - start));
+ *end = '\0';
+ if (g_str_has_prefix (start, "http://")) {
// DLNA 7.3.2.24.4 - URIs shall not exceed 256 bytes
// Also one part of CVE-2020-12695 mitigation - limit URI length
// UPnP does not impose any restrictions here
if (strlen (start) <= 256) {
- add_subscription_callback (context, data->callbacks, start);
+ add_subscription_callback (context, data->callbacks, start);
} else {
- g_warning ("Subscription URI exceeds recommended length of "
- "256 bytes, skipping");
+ g_warning ("Subscription URI exceeds recommended length "
+ "of 256 bytes, skipping");
}
- *end = '>';
}
+ *end = '>';
start = end;
}