From: Trent Lloyd Date: Sat, 16 Dec 2006 14:27:49 +0000 (+0000) Subject: * Limit the number of loops in consume_labels() (Closes: #84) X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=83b432c2369d7ef4142811bea0109b6588b6f313;p=catta * 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 --- 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)