From b8e92110ab1be4cdf1e834e0e97393c681e6d661 Mon Sep 17 00:00:00 2001 From: idealeer Date: Thu, 22 Sep 2022 11:54:23 +0800 Subject: [PATCH] XMap 1.1.1 Minor Release * XMap 1.1.1 Minor Release. * Fix Bugs: * Fix the memory leakage issue --- CHANGELOG.md | 5 +++++ src/probe_modules/module_dnsf.c | 4 ++-- src/probe_modules/module_dnsr.c | 4 ++-- src/probe_modules/module_dnss.c | 4 ++-- src/probe_modules/module_dnsv.c | 4 ++-- src/probe_modules/module_dnsx.c | 4 ++-- src/probe_modules/module_dnsz.c | 4 ++-- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc84b1c..15c48e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,3 +22,8 @@ * XMap 1.1.0 Major Release. * New Features: * DNS scan modules enabled (base module: `-M dnsx`, query for software version: `-M dnsv`, spoofing source address: `-M dnsf`, and so on) + +# 1.1.1 2022-09-22 +* XMap 1.1.1 Minor Release. +* Fix Bugs: + * Fix the memory leakage issue diff --git a/src/probe_modules/module_dnsf.c b/src/probe_modules/module_dnsf.c index ba0daf3..40d29ef 100644 --- a/src/probe_modules/module_dnsf.c +++ b/src/probe_modules/module_dnsf.c @@ -963,7 +963,7 @@ int dnsf_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *dst_ip, domains_f[index]); // dns packet - if (!qnames_f[index]) free(qnames_f[index]); + free(qnames_f[index]); qname_lens_f[index] = domain_to_qname_f(&qnames_f[index], new_domain); dns_packet_lens_f[index] = sizeof(dns_header) + qname_lens_f[index] + @@ -974,7 +974,7 @@ int dnsf_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *dst_ip, return EXIT_FAILURE; } - if (!dns_packets_f[index]) free(dns_packets_f[index]); + free(dns_packets_f[index]); dns_packets_f[index] = xmalloc(dns_packet_lens_f[index]); dns_header *dns_header_p = (dns_header *) dns_packets_f[index]; diff --git a/src/probe_modules/module_dnsr.c b/src/probe_modules/module_dnsr.c index 6421d7c..2d4b475 100644 --- a/src/probe_modules/module_dnsr.c +++ b/src/probe_modules/module_dnsr.c @@ -947,7 +947,7 @@ int dnsr_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, domains_r[index]); // dns packet - if (!qnames_r[index]) free(qnames_r[index]); + free(qnames_r[index]); qname_lens_r[index] = domain_to_qname_r(&qnames_r[index], new_domain); dns_packet_lens_r[index] = sizeof(dns_header) + qname_lens_r[index] + @@ -958,7 +958,7 @@ int dnsr_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, return EXIT_FAILURE; } - if (!dns_packets_r[index]) free(dns_packets_r[index]); + free(dns_packets_r[index]); dns_packets_r[index] = xmalloc(dns_packet_lens_r[index]); dns_header *dns_header_p = (dns_header *) dns_packets_r[index]; diff --git a/src/probe_modules/module_dnss.c b/src/probe_modules/module_dnss.c index 1bb6062..e1b732c 100644 --- a/src/probe_modules/module_dnss.c +++ b/src/probe_modules/module_dnss.c @@ -969,7 +969,7 @@ int dnss_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, domains_s[index]); // dns packet - if (!qnames_s[index]) free(qnames_s[index]); + free(qnames_s[index]); qname_lens_s[index] = domain_to_qname_s(&qnames_s[index], new_domain); dns_packet_lens_s[index] = sizeof(dns_header) + qname_lens_s[index] + @@ -980,7 +980,7 @@ int dnss_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, return EXIT_FAILURE; } - if (!dns_packets_s[index]) free(dns_packets_s[index]); + free(dns_packets_s[index]); dns_packets_s[index] = xmalloc(dns_packet_lens_s[index]); dns_header *dns_header_p = (dns_header *) dns_packets_s[index]; diff --git a/src/probe_modules/module_dnsv.c b/src/probe_modules/module_dnsv.c index 0cd0387..ecade38 100644 --- a/src/probe_modules/module_dnsv.c +++ b/src/probe_modules/module_dnsv.c @@ -962,7 +962,7 @@ int dnsv_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, domains_v[index]); // dns packet - if (!qnames_v[index]) free(qnames_v[index]); + free(qnames_v[index]); qname_lens_v[index] = domain_to_qname_v(&qnames_v[index], new_domain); dns_packet_lens_v[index] = sizeof(dns_header) + qname_lens_v[index] + @@ -973,7 +973,7 @@ int dnsv_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, return EXIT_FAILURE; } - if (!dns_packets_v[index]) free(dns_packets_v[index]); + free(dns_packets_v[index]); dns_packets_v[index] = xmalloc(dns_packet_lens_v[index]); dns_header *dns_header_p = (dns_header *) dns_packets_v[index]; diff --git a/src/probe_modules/module_dnsx.c b/src/probe_modules/module_dnsx.c index dbca8e9..d6475a1 100644 --- a/src/probe_modules/module_dnsx.c +++ b/src/probe_modules/module_dnsx.c @@ -995,7 +995,7 @@ int dnsx_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, domains_x[index]); // dns packet - if (!qnames_x[index]) free(qnames_x[index]); + free(qnames_x[index]); qname_lens_x[index] = domain_to_qname_x(&qnames_x[index], new_domain); dns_packet_lens_x[index] = sizeof(dns_header) + qname_lens_x[index] + @@ -1006,7 +1006,7 @@ int dnsx_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, return EXIT_FAILURE; } - if (!dns_packets_x[index]) free(dns_packets_x[index]); + free(dns_packets_x[index]); dns_packets_x[index] = xmalloc(dns_packet_lens_x[index]); dns_header *dns_header_p = (dns_header *) dns_packets_x[index]; diff --git a/src/probe_modules/module_dnsz.c b/src/probe_modules/module_dnsz.c index 5bd45b2..815a0e7 100644 --- a/src/probe_modules/module_dnsz.c +++ b/src/probe_modules/module_dnsz.c @@ -947,7 +947,7 @@ int dnsz_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, domains_z[index]); // dns packet - if (!qnames_z[index]) free(qnames_z[index]); + free(qnames_z[index]); qname_lens_z[index] = domain_to_qname_z(&qnames_z[index], new_domain); dns_packet_lens_z[index] = sizeof(dns_header) + qname_lens_z[index] + @@ -958,7 +958,7 @@ int dnsz_make_packet(void *buf, size_t *buf_len, ipaddr_n_t *src_ip, return EXIT_FAILURE; } - if (!dns_packets_z[index]) free(dns_packets_z[index]); + free(dns_packets_z[index]); dns_packets_z[index] = xmalloc(dns_packet_lens_z[index]); dns_header *dns_header_p = (dns_header *) dns_packets_z[index];