You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2017/05/10 20:16:37 UTC

[trafficserver] 01/01: coverity 1021761: Uninitialized pointer field

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

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

commit a218b83bd607e52fa0f7ebed9621f94cde999748
Author: Bryan Call <bc...@apache.org>
AuthorDate: Wed May 10 14:51:24 2017 -0400

    coverity 1021761: Uninitialized pointer field
---
 iocore/cache/P_CacheVol.h |  6 +++---
 tools/jtest/jtest.cc      | 26 +++++++++-----------------
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/iocore/cache/P_CacheVol.h b/iocore/cache/P_CacheVol.h
index 095f566..1fbd337 100644
--- a/iocore/cache/P_CacheVol.h
+++ b/iocore/cache/P_CacheVol.h
@@ -152,9 +152,9 @@ struct Vol : public Continuation {
   Event *trigger = nullptr;
 
   OpenDir open_dir;
-  RamCache *ram_cache = nullptr;
-  int evacuate_size   = 0;
-  DLL<EvacuationBlock> *evacuate;
+  RamCache *ram_cache            = nullptr;
+  int evacuate_size              = 0;
+  DLL<EvacuationBlock> *evacuate = nullptr;
   DLL<EvacuationBlock> lookaside[LOOKASIDE_SIZE];
   CacheVC *doc_evacuator = nullptr;
 
diff --git a/tools/jtest/jtest.cc b/tools/jtest/jtest.cc
index c3f2018..693c2be 100644
--- a/tools/jtest/jtest.cc
+++ b/tools/jtest/jtest.cc
@@ -318,17 +318,17 @@ struct FD {
 
   int state;   // request parsing state
   int req_pos; // request read position
-  char *base_url;
-  char *req_header;
-  char *response;
-  char *response_header;
+  char *base_url        = nullptr;
+  char *req_header      = nullptr;
+  char *response        = nullptr;
+  char *response_header = nullptr;
   int length;
   int response_length;
   int response_remaining;
-  int keepalive;
+  int keepalive = 0;
   int next;
-  int nalternate;
-  unsigned int ip;
+  int nalternate  = 0;
+  unsigned int ip = 0;
   unsigned int binary : 1;
   unsigned int ims : 1;
   unsigned int range : 1;
@@ -337,7 +337,7 @@ struct FD {
   unsigned int jg_compressed : 1;
   int *count;
   int bytes;
-  int ftp_data_fd;
+  int ftp_data_fd = 0;
   FTP_MODE ftp_mode;
   unsigned int ftp_peer_addr;
   unsigned short ftp_peer_port;
@@ -389,15 +389,7 @@ struct FD {
   }
 
   void close();
-  FD()
-    : base_url(nullptr),
-      req_header(nullptr),
-      response_header(nullptr),
-      keepalive(0),
-      nalternate(0),
-      ip(0),
-      binary(0),
-      ftp_data_fd(0)
+  FD() : binary(0)
   {
     ink_zero(name);
     reset();

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.