diff options
author | Dario Lombardo <lomato@gmail.com> | 2015-12-22 09:24:42 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-12-22 10:00:25 +0000 |
commit | 66ce1e6811728bc68e42cc9fc2e92de188505f03 (patch) | |
tree | a5f550f6c58fc88c7c4ce7ef34bc084e9ab54afe | |
parent | 3fd86f091843a541d76d4b76541a7a9dd94ab2a2 (diff) |
DNS: fix malformed warning when there is no quest(ions)
Change-Id: I14ef5244ddcc34fc0edea159e3e8593da8f50ffe
Reviewed-on: https://code.wireshark.org/review/12819
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r-- | epan/dissectors/packet-dns.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index f3be389a99..ea9bd5bd5d 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -3899,9 +3899,11 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dns_stats->packet_rcode = rcode; dns_stats->packet_opcode = opcode; dns_stats->packet_qr = flags >> 15; - get_dns_name_type_class(tvb, cur_off, dns_data_offset, &name, &name_len, &qtype, &qclass); - dns_stats->packet_qtype = qtype; - dns_stats->packet_qclass = qclass; + if (quest > 0) { + get_dns_name_type_class(tvb, cur_off, dns_data_offset, &name, &name_len, &qtype, &qclass); + dns_stats->packet_qtype = qtype; + dns_stats->packet_qclass = qclass; + } dns_stats->payload_size = tvb_captured_length(tvb); dns_stats->nquestions = quest; dns_stats->nanswers = ans; |