Skip to content

Commit

Permalink
XMap 1.1.1 Minor Release
Browse files Browse the repository at this point in the history
* XMap 1.1.1 Minor Release.
* Fix Bugs:
  * Fix the memory leakage issue
  • Loading branch information
idealeer committed Sep 22, 2022
1 parent 70af73b commit b8e9211
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/probe_modules/module_dnsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] +
Expand All @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/probe_modules/module_dnsr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] +
Expand All @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/probe_modules/module_dnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] +
Expand All @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/probe_modules/module_dnsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] +
Expand All @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/probe_modules/module_dnsx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] +
Expand All @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/probe_modules/module_dnsz.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] +
Expand All @@ -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];
Expand Down

0 comments on commit b8e9211

Please sign in to comment.