avahi/avahi-0.6.25-fixcrash.patch

31 lines
913 B
Diff

From ae19b3039335999e3c06f2bec9ae11ee79b204c1 Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Wed, 19 May 2010 15:43:44 +0200
Subject: [PATCH] ignore packet if FIONREAD returns zero
zero size is reported for corrupt packets. recvmsg() later could
nevertheless get data from a good packet that followed the bad one.
So get out early to avoid hitting an assertion.
---
avahi-core/socket.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/avahi-core/socket.c b/avahi-core/socket.c
index 4146d5a..8b9736a 100644
--- a/avahi-core/socket.c
+++ b/avahi-core/socket.c
@@ -805,6 +805,10 @@ AvahiDnsPacket *avahi_recv_dns_packet_ipv6(
goto fail;
}
+ /* corrupt packets have zero size */
+ if (!ms)
+ goto fail;
+
p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE);
io.iov_base = AVAHI_DNS_PACKET_DATA(p);
--
1.6.4.2