Skip to content

Commit

Permalink
DNS: fix malformed warning when there is no quest(ions)
Browse files Browse the repository at this point in the history
Change-Id: I14ef5244ddcc34fc0edea159e3e8593da8f50ffe
Reviewed-on: https://code.wireshark.org/review/12819
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
  • Loading branch information
crondaemon authored and alagoutte committed Dec 22, 2015
1 parent 3fd86f0 commit 66ce1e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions epan/dissectors/packet-dns.c
Expand Up @@ -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;
Expand Down

0 comments on commit 66ce1e6

Please sign in to comment.