[gupnp-av] Don't loop endlessly on large protocol-info



commit b168dacfe8666b1ab9c9657fe3c320b77e402c84
Author: Jens Georg <mail jensge org>
Date:   Sun Mar 18 14:37:13 2012 +0100

    Don't loop endlessly on large protocol-info
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671246

 libgupnp-av/gupnp-didl-lite-object.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libgupnp-av/gupnp-didl-lite-object.c b/libgupnp-av/gupnp-didl-lite-object.c
index 3eea19b..0d60547 100644
--- a/libgupnp-av/gupnp-didl-lite-object.c
+++ b/libgupnp-av/gupnp-didl-lite-object.c
@@ -757,16 +757,16 @@ is_resource_compatible (GUPnPDIDLLiteResource *resource,
                         const char            *sink_protocol_info)
 {
         gboolean ret = FALSE;
-        char **protocols;
-        guint8 i;
+        char **protocols, **it;
 
         protocols = g_strsplit (sink_protocol_info, ",", 0);
 
-        for (i = 0; protocols[i] && !ret; i++) {
+
+        for (it = protocols; it != NULL && !ret; it++) {
                 GUPnPProtocolInfo *info;
                 GUPnPProtocolInfo *res_info;
 
-                info = gupnp_protocol_info_new_from_string (protocols[i], NULL);
+                info = gupnp_protocol_info_new_from_string (*it, NULL);
                 if (info == NULL)
                         continue;
 



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