[Pkg-utopia-commits] r1603 - in /packages/unstable/avahi/debian: changelog patches/15_avahi_dns_truncate.patch
sjoerd at users.alioth.debian.org
sjoerd at users.alioth.debian.org
Tue Jul 10 19:24:47 UTC 2007
Author: sjoerd
Date: Tue Jul 10 19:24:47 2007
New Revision: 1603
URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=1603
Log:
* debian/patches/15_avahi_dns_truncate.patch:
+ Added. Fix truncating of dns packets when their too big. Could cause
assertion failures
Added:
packages/unstable/avahi/debian/patches/15_avahi_dns_truncate.patch
Modified:
packages/unstable/avahi/debian/changelog
Modified: packages/unstable/avahi/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/avahi/debian/changelog?rev=1603&op=diff
==============================================================================
--- packages/unstable/avahi/debian/changelog (original)
+++ packages/unstable/avahi/debian/changelog Tue Jul 10 19:24:47 2007
@@ -1,6 +1,8 @@
avahi (0.6.20-2) UNRELEASED; urgency=low
- * NOT RELEASED YET
+ * debian/patches/15_avahi_dns_truncate.patch:
+ + Added. Fix truncating of dns packets when their too big. Could cause
+ assertion failures
-- Sjoerd Simons <sjoerd at debian.org> Fri, 06 Jul 2007 16:10:32 +0200
Added: packages/unstable/avahi/debian/patches/15_avahi_dns_truncate.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/avahi/debian/patches/15_avahi_dns_truncate.patch?rev=1603&op=file
==============================================================================
--- packages/unstable/avahi/debian/patches/15_avahi_dns_truncate.patch (added)
+++ packages/unstable/avahi/debian/patches/15_avahi_dns_truncate.patch Tue Jul 10 19:24:47 2007
@@ -1,0 +1,53 @@
+Index: avahi-core/dns.c
+===================================================================
+--- avahi-core/dns.c (revision 1492)
++++ avahi-core/dns.c (working copy)
+@@ -153,6 +153,22 @@
+ avahi_dns_packet_set_field(p, idx, avahi_dns_packet_get_field(p, idx) + 1);
+ }
+
++
++static void
++name_table_cleanup(void *key, void *value, void *user_data) {
++ AvahiDnsPacket *p = (AvahiDnsPacket *)user_data;
++
++ if ((uint8_t *)value >= AVAHI_DNS_PACKET_DATA(p) + p->size) {
++ avahi_hashmap_remove(p->name_table, key);
++ }
++}
++
++static void
++avahi_dns_packet_cleanup_name_table(AvahiDnsPacket *p) {
++ if (p->name_table)
++ avahi_hashmap_foreach(p->name_table, name_table_cleanup, p);
++}
++
+ uint8_t* avahi_dns_packet_append_name(AvahiDnsPacket *p, const char *name) {
+ uint8_t *d, *saved_ptr = NULL;
+ size_t saved_size;
+@@ -216,6 +232,8 @@
+
+ fail:
+ p->size = saved_size;
++ avahi_dns_packet_cleanup_name_table(p);
++
+ return NULL;
+ }
+
+@@ -685,6 +703,7 @@
+ !avahi_dns_packet_append_uint16(p, k->type) ||
+ !avahi_dns_packet_append_uint16(p, k->clazz | (unicast_response ? AVAHI_DNS_UNICAST_RESPONSE : 0))) {
+ p->size = size;
++ avahi_dns_packet_cleanup_name_table(p);
+ return NULL;
+ }
+
+@@ -799,6 +818,8 @@
+
+ fail:
+ p->size = size;
++ avahi_dns_packet_cleanup_name_table(p);
++
+ return NULL;
+ }
+
More information about the Pkg-utopia-commits
mailing list