tcp dns: fix advancement to next request in buffer

The advancement through the buffer was not taking into account
the size of the length field resulting in the second request
being detected as bad data.
pull/2386/head
Jason Ish 8 years ago
parent db1c47cb6e
commit 2d4df19401

@ -321,8 +321,8 @@ next_record:
goto bad_data;
/* treat the rest of the data as a (potential) new record */
input += ntohs(dns_tcp_header->len);
input_len -= ntohs(dns_tcp_header->len);
input += (2 + ntohs(dns_tcp_header->len));
input_len -= (2 + ntohs(dns_tcp_header->len));
goto next_record;
} else {
/* not enough data, store record length and buffer */
@ -534,8 +534,8 @@ next_record:
goto bad_data;
/* treat the rest of the data as a (potential) new record */
input += ntohs(dns_tcp_header->len);
input_len -= ntohs(dns_tcp_header->len);
input += (2 + ntohs(dns_tcp_header->len));
input_len -= (2 + ntohs(dns_tcp_header->len));
goto next_record;
} else {
/* not enough data, store record length and buffer */

Loading…
Cancel
Save