From: Shravan Rangarajuvenkata (shrarang) Date: Tue, 24 Sep 2019 19:07:30 +0000 (-0400) Subject: Merge pull request #1758 in SNORT/snort3 from ~KAMURTHI/snort3:DNS_QUERY to master X-Git-Tag: 3.0.0-262~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee600d0ab1ae4c929ee1780bbe62b9050e9c7422;p=thirdparty%2Fsnort3.git Merge pull request #1758 in SNORT/snort3 from ~KAMURTHI/snort3:DNS_QUERY to master Squashed commit of the following: commit 0c8de28d008b2812203326458452265f48fffeba Author: kani Date: Mon Sep 23 11:39:21 2019 -0400 Appid: fix populating dns_query for DNS traffic --- diff --git a/src/network_inspectors/appid/detector_plugins/detector_dns.cc b/src/network_inspectors/appid/detector_plugins/detector_dns.cc index 5d6be3284..81d4986a9 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_dns.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_dns.cc @@ -267,13 +267,14 @@ void DnsValidator::add_dns_query_info(AppIdSession& asd, uint16_t id, const uint dsession->set_id(id); dsession->set_record_type(record_type); - if (!dsession->get_host()) + if (!dsession->get_host_len()) { if ((host != nullptr) && (host_len > 0) && (host_offset > 0)) { char* new_host = dns_parse_host(host, host_len); dsession->set_host(new_host); dsession->set_host_offset(host_offset); + snort_free(new_host); } } } @@ -293,13 +294,14 @@ void DnsValidator::add_dns_response_info(AppIdSession& asd, uint16_t id, const u dsession->set_ttl(ttl); dsession->set_response_type(response_type); - if (!dsession->get_host()) + if (!dsession->get_host_len()) { if ((host != nullptr) && (host_len > 0) && (host_offset > 0)) { char* new_host = dns_parse_host(host, host_len); dsession->set_host(new_host); dsession->set_host_offset(host_offset); + snort_free(new_host); } } }