summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2006-12-16 14:27:49 +0000
committerTrent Lloyd <lathiat@bur.st>2006-12-16 14:27:49 +0000
commit83b432c2369d7ef4142811bea0109b6588b6f313 (patch)
tree2549d8fd91fa17419fc8887aac98eb70ab00b5ca
parentfc2fc59b512cddcd54448144222de1d4e286e32e (diff)
* 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
-rw-r--r--avahi-core/dns.c3
1 files changed, 2 insertions, 1 deletions
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)