Mayaqua/DNS: Fix memory safety in DNS operation threads

Fix #1329
This commit is contained in:
Yihong Wu committed 2021-12-12 20:05:36 +08:00
1 parent 2a40d21ef9
commit b91d9af5e3
3 files changed
+95 -43

No files matched your search

+6 -1
View File
@@ -38,6 +38,7 @@ struct DNS_CACHE_REVERSE
struct DNS_RESOLVER
{
REF *Ref;
const char *Hostname;
LIST *IPList_v4;
LIST *IPList_v6;
@@ -46,6 +47,7 @@ struct DNS_RESOLVER
struct DNS_RESOLVER_REVERSE
{
REF *Ref;
IP IP;
char *Hostname;
bool OK;
@@ -69,7 +71,7 @@ DNS_CACHE_REVERSE *DnsCacheReverseFind(const IP *ip);
DNS_CACHE_REVERSE *DnsCacheReverseUpdate(const IP *ip, const char *hostname);
bool DnsResolve(IP *ipv6, IP *ipv4, const char *hostname, UINT timeout, volatile const bool *cancel_flag);
bool DnsResolveEx(LIST *iplist_v6, LIST *iplist_v4, const char *hostname, UINT timeout, volatile const bool *cancel_flag);
bool DnsResolveEx(LIST **iplist_v6, LIST **iplist_v4, const char *hostname, UINT timeout, volatile const bool *cancel_flag);
void DnsResolver(THREAD *t, void *param);
bool DnsResolveReverse(char *dst, const UINT size, const IP *ip, UINT timeout, volatile const bool *cancel_flag);
@@ -77,4 +79,7 @@ void DnsResolverReverse(THREAD *t, void *param);
bool GetIPEx(IP *ip, const char *hostname, UINT timeout, volatile const bool *cancel_flag);
void ReleaseDnsResolver(DNS_RESOLVER *p);
void ReleaseDnsResolverReverse(DNS_RESOLVER_REVERSE *p);
#endif