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/11 20:46:50 UTC
[trafficserver] branch master updated: coverity 1242338:
Uninitialized pointer field
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new d01a6b3 coverity 1242338: Uninitialized pointer field
d01a6b3 is described below
commit d01a6b3d1f88cbf17762ff95755a12b61d63dd93
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu May 11 14:04:10 2017 -0400
coverity 1242338: Uninitialized pointer field
---
lib/cppapi/InterceptPlugin.cc | 41 +++++++++++++++--------------------------
1 file changed, 15 insertions(+), 26 deletions(-)
diff --git a/lib/cppapi/InterceptPlugin.cc b/lib/cppapi/InterceptPlugin.cc
index 86caf15..cd4ddaa 100644
--- a/lib/cppapi/InterceptPlugin.cc
+++ b/lib/cppapi/InterceptPlugin.cc
@@ -42,7 +42,7 @@ using std::string;
*/
struct InterceptPlugin::State {
TSCont cont_;
- TSVConn net_vc_;
+ TSVConn net_vc_ = nullptr;
struct IoHandle {
TSVIO vio_;
@@ -66,36 +66,25 @@ struct InterceptPlugin::State {
/** the API doesn't recognize end of input; so we have to explicitly
* figure out when to continue reading and when to stop */
TSHttpParser http_parser_;
- int expected_body_size_;
- int num_body_bytes_read_;
- bool hdr_parsed_;
+ int expected_body_size_ = 0;
+ int num_body_bytes_read_ = 0;
+ bool hdr_parsed_ = false;
- TSMBuffer hdr_buf_;
- TSMLoc hdr_loc_;
- int num_bytes_written_;
+ TSMBuffer hdr_buf_ = nullptr;
+ TSMLoc hdr_loc_ = nullptr;
+ int num_bytes_written_ = 0;
std::shared_ptr<Mutex> plugin_mutex_;
- InterceptPlugin *plugin_;
+ InterceptPlugin *plugin_ = nullptr;
Headers request_headers_;
/** these two fields to be used by the continuation callback only */
- TSEvent saved_event_;
- void *saved_edata_;
-
- TSAction timeout_action_;
- bool plugin_io_done_;
-
- State(TSCont cont, InterceptPlugin *plugin)
- : cont_(cont),
- net_vc_(nullptr),
- expected_body_size_(0),
- num_body_bytes_read_(0),
- hdr_parsed_(false),
- hdr_buf_(nullptr),
- hdr_loc_(nullptr),
- num_bytes_written_(0),
- plugin_(plugin),
- timeout_action_(nullptr),
- plugin_io_done_(false)
+ TSEvent saved_event_ = TS_EVENT_NONE;
+ void *saved_edata_ = nullptr;
+
+ TSAction timeout_action_ = nullptr;
+ bool plugin_io_done_ = false;
+
+ State(TSCont cont, InterceptPlugin *plugin) : cont_(cont)
{
plugin_mutex_ = plugin->getMutex();
http_parser_ = TSHttpParserCreate();
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].