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 21e08d3d8f Coverity 1545945: Uninitialized scalar variable in icap 
plugin (#11385)
21e08d3d8f is described below

commit 21e08d3d8f1bc8d9ba3f8e21cc27cc353d22a500
Author: Bryan Call <bc...@apache.org>
AuthorDate: Wed May 22 14:37:48 2024 -0700

    Coverity 1545945: Uninitialized scalar variable in icap plugin (#11385)
---
 plugins/experimental/icap/icap_plugin.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/experimental/icap/icap_plugin.cc 
b/plugins/experimental/icap/icap_plugin.cc
index 86e45ff1cc..ac8d64c931 100644
--- a/plugins/experimental/icap/icap_plugin.cc
+++ b/plugins/experimental/icap/icap_plugin.cc
@@ -820,8 +820,8 @@ transform_read_icap_header_event(TSCont contp, 
TransformData *data, TSEvent even
     TSStatIntIncrement(icap_response_err, 1);
     return handle_invalid_icap_behavior(contp, data, "Invalid ICAP server 
reply: reading icap header");
   case TS_EVENT_VCONN_READ_READY: {
-    TSIOBufferReader reader = data->icap_resp_reader;
-    int64_t          avail;
+    TSIOBufferReader reader      = data->icap_resp_reader;
+    int64_t          avail       = 0;
     int64_t          consumed    = data->icap_header.size();
     int64_t          read_nbytes = INT64_MAX;
 
@@ -835,8 +835,8 @@ transform_read_icap_header_event(TSCont contp, 
TransformData *data, TSEvent even
       /* Read in the icap header */
       data->icap_header += chunk;
       // Dbg(dbg_ctl, "Headers: \n%s", icap_header.c_str());
-      int64_t pos          = data->icap_header.find("\r\n\r\n");
-      int64_t token_length = std::string("\r\n\r\n").size();
+      int64_t           pos          = data->icap_header.find("\r\n\r\n");
+      constexpr int64_t token_length = std::string_view("\r\n\r\n").size();
 
       if (pos != static_cast<int64_t>(std::string::npos)) {
         data->icap_header.resize(pos);

Reply via email to