diff options
-rw-r--r-- | avahi-core/dns.c | 2 | ||||
-rw-r--r-- | avahi-core/dns.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/avahi-core/dns.c b/avahi-core/dns.c index fec55e4..a3ec0e6 100644 --- a/avahi-core/dns.c +++ b/avahi-core/dns.c @@ -335,7 +335,7 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_ int i; assert(p && ret_name && l); - for (i = 0; i < 127; i++) { + for (i = 0; i < AVAHI_DNS_LABELS_MAX; i++) { uint8_t n; if (idx+1 > p->size) diff --git a/avahi-core/dns.h b/avahi-core/dns.h index 4696e00..d1c06a5 100644 --- a/avahi-core/dns.h +++ b/avahi-core/dns.h @@ -28,6 +28,7 @@ #define AVAHI_DNS_PACKET_SIZE_MAX 9000 #define AVAHI_DNS_PACKET_HEADER_SIZE 12 #define AVAHI_DNS_PACKET_EXTRA_SIZE 48 +#define AVAHI_DNS_LABELS_MAX 127 typedef struct AvahiDnsPacket { size_t size, rindex, max_size; |