summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2020-10-12 16:33:18 +0800
committerliuxueli <[email protected]>2020-10-12 16:33:18 +0800
commit480e220ec2ef947d38f655387402fa88509ce16e (patch)
treecd97753d620ec87860399d2bad7cf05154a89413
parent496e85122867babacea5760abdf42a48b5228494 (diff)
修复BUG,声明全局变量长度与使用不一致导致ASAN报错
-rw-r--r--src/dns.cpp2
-rw-r--r--src/dns_internal.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index f38b53c..a33b80b 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -81,7 +81,7 @@ static dns_str_contrast_id_t DNS_FLAG_ID[] =
{"DNS_RES_ADD", DNS_RES_ADD}
};
-static dns_str_contrast_id_t DNS_STATIS_INFO[] =
+static dns_str_contrast_id_t DNS_STATIS_INFO[DNS_MAX_FIELD_ID_NUM] =
{
{"V4_T_PPS", V4_T_PPS},
{"V4_T_BPS", V4_T_BPS},
diff --git a/src/dns_internal.h b/src/dns_internal.h
index 0de653f..24fe6ec 100644
--- a/src/dns_internal.h
+++ b/src/dns_internal.h
@@ -144,7 +144,7 @@ enum dns_statis_info_t
Q_UNKNOWN
};
-#define DNS_MAX_FIELD_ID_NUM 32
+#define DNS_MAX_FIELD_ID_NUM 17
typedef struct _dns_proto_info
{