]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: dns: parsing error of some DNS response
authorBaptiste Assmann <bedis9@gmail.com>
Thu, 15 Oct 2015 13:23:28 +0000 (15:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 Oct 2015 20:05:59 +0000 (22:05 +0200)
The function which parses a DNS response buffer did not move properly a
pointer when reading a packet where records does not use DNS "message
compression" techniques.

Thanks to 0yvind Johnsen for the help provided during the troubleshooting
session.

src/dns.c

index fee5f5fc2894f77cc1fb02abd2434c121687cb2d..7f71ac7e96ea00b07406a52575bc3bd50679c244 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -504,6 +504,8 @@ int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, char *
                                        return DNS_RESP_INVALID;
                                if (memcmp(ptr, dn_name, dn_name_len) != 0)
                                        return DNS_RESP_WRONG_NAME;
+
+                               reader += (dn_name_len + 1);
                        }
                        else {
                                reader += (len + 1);