From 83b432c2369d7ef4142811bea0109b6588b6f313 Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Sat, 16 Dec 2006 14:27:49 +0000 Subject: [PATCH] * Limit the number of loops in consume_labels() (Closes: #84) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1340 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/dns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/avahi-core/dns.c b/avahi-core/dns.c index c545c00..fec55e4 100644 --- a/avahi-core/dns.c +++ b/avahi-core/dns.c @@ -332,9 +332,10 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_ int ret = 0; int compressed = 0; int first_label = 1; + int i; assert(p && ret_name && l); - for (;;) { + for (i = 0; i < 127; i++) { uint8_t n; if (idx+1 > p->size) -- 2.39.5