Commit c67626e9 authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Patch DNS parser abstract classes to define virtual destructors.

This avoid undefined behavior on destruction (i.e. ASan's
new-delete-type-mismatch).
parent fb83a7ea
......@@ -6,6 +6,7 @@ set(ZDNSPARSER_FILENAME
set(PATCHES
${CMAKE_CURRENT_LIST_DIR}/zdnsparser/disable-tests.patch
${CMAKE_CURRENT_LIST_DIR}/zdnsparser/virtual-destructors.patch
)
set(PATCH_COMMAND
......
diff --git a/include/dnsparser.h b/include/dnsparser.h
index 4d81ea3..5dfaa6c 100644
--- a/include/dnsparser.h
+++ b/include/dnsparser.h
@@ -18,6 +18,8 @@
class DnsParserListener
{
public:
+ virtual ~DnsParserListener() = default;
+
/**
* @param addr Binary IPV4 or IPV6 address in network order.
* @param name Domain name requested.
@@ -30,6 +32,8 @@ public:
class DnsParser
{
public:
+ virtual ~DnsParser() = default;
+
/**
* parse
* When response records are discovered, DnsParserListener.onDnsRec()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment