diff options
| author | liuxueli <[email protected]> | 2019-12-24 17:37:07 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2019-12-24 17:37:07 +0800 |
| commit | ef3076fd10c8730cb3ad19c5470f88d85c9c295c (patch) | |
| tree | 4f78336acdc2b0d3ece0778d5a405513c4220865 | |
| parent | e912615097de1c702683fac53b2ad327ad64bd15 (diff) | |
不支持解析请求包中缺少请求域名的数据包,遇到请求包中缺少请求域名的情况不回调业务层for-GD
| -rw-r--r-- | src/dns.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dns.cpp b/src/dns.cpp index 2872d04..c11f44a 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -1382,13 +1382,19 @@ int parse_query_question(struct streaminfo *a_stream, dns_info_t *dns_info, char if(0 == dns_info->hdr_info.qdcount || dns_info->hdr_info.qdcount > 1) { - return APP_STATE_GIVEME; + return APP_STATE_DROPME; } dns_info->query_question = (dns_query_question_t *)calloc(dns_info->hdr_info.qdcount, sizeof(dns_query_question_t)); if(0 != (ret = get_dns_query_question(payload, cur_pos, dns_info->query_question, payload+payload_len))) { + if(dns_info->query_question!=NULL) + { + free(dns_info->query_question); + dns_info->query_question=NULL; + } + if(ret == -2) { dns_save_error_pkt(a_stream, DNS_ERROR_QUESTION); |
