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 94ed147b31 Fix uninitialized pointer/field members in core classes
(#12976)
94ed147b31 is described below
commit 94ed147b31483dfebc1ddf35de180f3ba9f8bf8a
Author: Bryan Call <[email protected]>
AuthorDate: Wed Mar 18 12:14:35 2026 -0700
Fix uninitialized pointer/field members in core classes (#12976)
Initialize members flagged by Coverity:
- CID 1497424: `HttpTransact::_ResponseAction` (value-init
`TSResponseAction`)
- CID 1497385, CID 1497345: `ProxySession::accept_options` -> `nullptr`
- CID 1021718: `FetchSM::callback_events` (value-init `TSFetchEvent`)
- CID 1508857: `HTTPStatsConfig::cont` -> `nullptr`
---
include/proxy/FetchSM.h | 2 +-
include/proxy/ProxySession.h | 2 +-
include/proxy/http/HttpTransact.h | 6 ++----
plugins/experimental/http_stats/http_stats.cc | 9 +++++++--
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/include/proxy/FetchSM.h b/include/proxy/FetchSM.h
index 2cf4b3bdef..2ea205fe4b 100644
--- a/include/proxy/FetchSM.h
+++ b/include/proxy/FetchSM.h
@@ -165,7 +165,7 @@ private:
HTTPParser http_parser;
HTTPHdr client_response_hdr;
ChunkedHandler chunked_handler;
- TSFetchEvent callback_events;
+ TSFetchEvent callback_events{};
TSFetchWakeUpOptions callback_options = NO_CALLBACK;
bool req_finished = false;
bool header_done = false;
diff --git a/include/proxy/ProxySession.h b/include/proxy/ProxySession.h
index a94bdf4dd4..398130bdee 100644
--- a/include/proxy/ProxySession.h
+++ b/include/proxy/ProxySession.h
@@ -184,7 +184,7 @@ public:
IpAllow::ACL acl; ///< IpAllow based method ACL.
- HttpSessionAccept::Options const *accept_options; ///< connection info //
L7R TODO: set in constructor
+ HttpSessionAccept::Options const *accept_options{nullptr}; ///< connection
info
protected:
// Hook dispatching state
diff --git a/include/proxy/http/HttpTransact.h
b/include/proxy/http/HttpTransact.h
index 52c92a9cb7..33f4eafe89 100644
--- a/include/proxy/http/HttpTransact.h
+++ b/include/proxy/http/HttpTransact.h
@@ -655,10 +655,8 @@ public:
};
using ResponseAction = struct _ResponseAction {
- bool handled = false;
- TSResponseAction action;
-
- _ResponseAction() {}
+ bool handled{false};
+ TSResponseAction action{};
};
struct State {
diff --git a/plugins/experimental/http_stats/http_stats.cc
b/plugins/experimental/http_stats/http_stats.cc
index 2e67570470..1a79c01fcb 100644
--- a/plugins/experimental/http_stats/http_stats.cc
+++ b/plugins/experimental/http_stats/http_stats.cc
@@ -81,7 +81,12 @@ struct HTTPStatsFormatter {
struct HTTPStatsConfig {
explicit HTTPStatsConfig() {}
- ~HTTPStatsConfig() { TSContDestroy(cont); }
+ ~HTTPStatsConfig()
+ {
+ if (cont) {
+ TSContDestroy(cont);
+ }
+ }
std::string mimeType;
int maxAge = 0;
@@ -89,7 +94,7 @@ struct HTTPStatsConfig {
bool integer_counters = false;
bool wrap_counters = false;
- TSCont cont;
+ TSCont cont{nullptr};
};
struct HTTPStatsRequest;