[gupnp/gupnp-1.0] service: Style fixes



commit dc02a1566329c0d2a447b7713357b8d9664796df
Author: Jens Georg <mail jensge org>
Date:   Wed Jun 17 13:47:56 2020 +0200

    service: Style fixes

 libgupnp/gupnp-context.c |  4 ++--
 libgupnp/gupnp-service.c | 13 ++++++-------
 2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index 42c5fef..aac917d 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -1571,8 +1571,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 3b0c4b9..d3da2c3 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -1232,20 +1232,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;
         }


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