This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7b4c6a8cd5a9de6f259f7b52812f67fec78546b8
Author: Phil Sorber <[email protected]>
AuthorDate: Thu May 11 13:27:08 2017 -0600

    Coverity CID #1021755 Uninitialized pointer field
---
 iocore/dns/I_DNSProcessor.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/iocore/dns/I_DNSProcessor.h b/iocore/dns/I_DNSProcessor.h
index 564582d..965fd1c 100644
--- a/iocore/dns/I_DNSProcessor.h
+++ b/iocore/dns/I_DNSProcessor.h
@@ -41,12 +41,12 @@
 */
 struct HostEnt : RefCountObj {
   struct hostent ent;
-  uint32_t ttl;
-  int packet_size;
-  char buf[MAX_DNS_PACKET_LEN];
-  u_char *host_aliases[DNS_MAX_ALIASES];
-  u_char *h_addr_ptrs[DNS_MAX_ADDRS + 1];
-  u_char hostbuf[DNS_HOSTBUF_SIZE];
+  uint32_t ttl                           = 0;
+  int packet_size                        = 0;
+  char buf[MAX_DNS_PACKET_LEN]           = {0};
+  u_char *host_aliases[DNS_MAX_ALIASES]  = {nullptr};
+  u_char *h_addr_ptrs[DNS_MAX_ADDRS + 1] = {nullptr};
+  u_char hostbuf[DNS_HOSTBUF_SIZE]       = {0};
 
   SRVHosts srv_hosts;
 
@@ -54,8 +54,8 @@ struct HostEnt : RefCountObj {
 
   HostEnt()
   {
-    size_t base = sizeof(force_VFPT_to_top); // preserve VFPT
-    memset(((char *)this) + base, 0, sizeof(*this) - base);
+    ink_zero(ent);
+    ink_zero(srv_hosts);
   }
 };
 

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to