]> git.meshlink.io Git - catta/commitdiff
fix a local DoS (by hitting an assert) when passing empty TXT strings to the avahi...
authorLennart Poettering <lennart@poettering.net>
Mon, 21 May 2007 17:13:05 +0000 (17:13 +0000)
committerLennart Poettering <lennart@poettering.net>
Mon, 21 May 2007 17:13:05 +0000 (17:13 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1482 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-common/strlst.c
avahi-daemon/dbus-util.c

index c6ceb0f7351670c6c2dc087353fa854dac9009c9..9ffa18e0e75c14e8bb98fe6f7e0ce77a48b641a1 100644 (file)
@@ -51,7 +51,7 @@ AvahiStringList*avahi_string_list_add_anonymous(AvahiStringList *l, size_t size)
 AvahiStringList *avahi_string_list_add_arbitrary(AvahiStringList *l, const uint8_t*text, size_t size) {
     AvahiStringList *n;
 
-    assert(text);
+    assert(size == 0 || text);
 
     if (!(n = avahi_string_list_add_anonymous(l, size)))
         return NULL;
index d1a7a201077e245c61fc1999b944978a70ac3d22..ca08d7b1dffb1461c57aed62fc187b51e39704ac 100644 (file)
@@ -344,6 +344,9 @@ int avahi_dbus_read_strlst(DBusMessage *m, int idx, AvahiStringList **l) {
         k = (const uint8_t*) "";
         n = 0;
         dbus_message_iter_get_fixed_array(&sub2, &k, &n);
+
+        if (!k)
+            k = (const uint8_t*) "";
             
         strlst = avahi_string_list_add_arbitrary(strlst, k, n);