]> git.meshlink.io Git - catta/commitdiff
* fix "sebest's bug" (TM) -- deal with dbus brokeness when passing zero length arrays
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Aug 2005 19:34:51 +0000 (19:34 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Aug 2005 19:34:51 +0000 (19:34 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@446 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-client/resolver.c

index 66208cf48461cdb5dd390885ce6df5c26beae7bc..f23f9d79e1e6d3faafc438e3f2a835c83fbdd551 100644 (file)
@@ -93,8 +93,7 @@ static void pending_call_callback(DBusPendingCall *pending, void *userdata) {
         
         for (;;) {
             DBusMessageIter sub2;
-            int at, n;
-            uint8_t *k;
+            int at;
             
             if ((at = dbus_message_iter_get_arg_type(&sub)) == DBUS_TYPE_INVALID)
                 break;
@@ -107,8 +106,14 @@ static void pending_call_callback(DBusPendingCall *pending, void *userdata) {
             }
             
             dbus_message_iter_recurse(&sub, &sub2);
-            dbus_message_iter_get_fixed_array(&sub2, &k, &n);
-            strlst = avahi_string_list_add_arbitrary(strlst, k, n);
+
+            if (dbus_message_iter_get_array_len(&sub2) > 0) {
+                uint8_t *k;
+                int n;
+                
+                dbus_message_iter_get_fixed_array(&sub2, &k, &n);
+                strlst = avahi_string_list_add_arbitrary(strlst, k, n);
+            }
             
             dbus_message_iter_next(&sub);
         }