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 2747c99381 Fix Coverity UNINIT issues (#12842)
2747c99381 is described below

commit 2747c99381507eca3a59486af6cc1068f1ae3dec
Author: Bryan Call <[email protected]>
AuthorDate: Mon Feb 2 16:02:18 2026 -0800

    Fix Coverity UNINIT issues (#12842)
    
    * Fix uninitialized DiagsConfigState in reconfigure_diags
    
    Value-initialize DiagsConfigState to ensure the outputs array
    members are initialized to false before use. This fixes Coverity
    CID 1497238 (UNINIT).
    
    * Fix uninitialized ParsedValue in ParsedConfigCache::parse
    
    Explicitly value-initialize ParsedValue to ensure the variant member
    is properly initialized. This fixes Coverity CID 1644237 (UNINIT).
    
    * Fix uninitialized TLSClientHelloSummary in test_ja4
    
    Value-initialize TLSClientHelloSummary to ensure all members are
    properly initialized before use. This fixes Coverity CID 1644228 (UNINIT).
    
    * Fix uninitialized IPRange in background_fetch and cache_fill plugins
    
    The condition for parsing Client-IP was inverted - it should load the
    IP range when the value is NOT a single '*' character. With the old
    logic, single-character non-'*' values would skip loading, leaving
    the IPRange uninitialized.
    
    This fixes Coverity CID 1533658 (UNINIT).
---
 plugins/background_fetch/configs.cc              | 2 +-
 plugins/experimental/cache_fill/configs.cc       | 2 +-
 plugins/experimental/ja4_fingerprint/test_ja4.cc | 2 +-
 src/proxy/http/HttpConfig.cc                     | 2 +-
 src/proxy/shared/DiagsConfig.cc                  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/background_fetch/configs.cc 
b/plugins/background_fetch/configs.cc
index 27d48f0905..5a6b5099b9 100644
--- a/plugins/background_fetch/configs.cc
+++ b/plugins/background_fetch/configs.cc
@@ -136,7 +136,7 @@ BgFetchConfig::readConfig(const char *config_file)
         if ("Client-IP"_tv == cfg_name) {
           swoc::IPRange r;
           // '*' is special - match any address. Signalled by empty range.
-          if (cfg_value.size() != 1 || cfg_value.front() == '*') {
+          if (cfg_value.size() != 1 || cfg_value.front() != '*') {
             if (!r.load(cfg_value)) { // assume if it loads, it's not empty.
               TSError("[%s] invalid IP address range %.*s, skipping config 
value", PLUGIN_NAME, int(cfg_value.size()),
                       cfg_value.data());
diff --git a/plugins/experimental/cache_fill/configs.cc 
b/plugins/experimental/cache_fill/configs.cc
index b65f0aa765..26b2e1967c 100644
--- a/plugins/experimental/cache_fill/configs.cc
+++ b/plugins/experimental/cache_fill/configs.cc
@@ -146,7 +146,7 @@ BgFetchConfig::readConfig(const char *config_file)
         if ("Client-IP"_tv == cfg_name) {
           swoc::IPRange r;
           // '*' is special - match any address. Signalled by empty range.
-          if (cfg_value.size() != 1 || cfg_value.front() == '*') {
+          if (cfg_value.size() != 1 || cfg_value.front() != '*') {
             if (!r.load(cfg_value)) { // assume if it loads, it's not empty.
               TSError("[%s] invalid IP address range %.*s, skipping config 
value", PLUGIN_NAME, int(cfg_value.size()),
                       cfg_value.data());
diff --git a/plugins/experimental/ja4_fingerprint/test_ja4.cc 
b/plugins/experimental/ja4_fingerprint/test_ja4.cc
index ffc2f6820c..c941283ed8 100644
--- a/plugins/experimental/ja4_fingerprint/test_ja4.cc
+++ b/plugins/experimental/ja4_fingerprint/test_ja4.cc
@@ -37,7 +37,7 @@ static std::string inc(std::string_view sv);
 
 TEST_CASE("JA4")
 {
-  JA4::TLSClientHelloSummary TLS_summary;
+  JA4::TLSClientHelloSummary TLS_summary{};
 
   SECTION("Given the protocol is TCP, "
           "when we create a JA4 fingerprint, "
diff --git a/src/proxy/http/HttpConfig.cc b/src/proxy/http/HttpConfig.cc
index 3b7352b1fc..d58f7d7c01 100644
--- a/src/proxy/http/HttpConfig.cc
+++ b/src/proxy/http/HttpConfig.cc
@@ -745,7 +745,7 @@ ParsedConfigCache::lookup_impl(TSOverridableConfigKey key, 
std::string_view valu
 ParsedConfigCache::ParsedValue
 ParsedConfigCache::parse(TSOverridableConfigKey key, std::string_view value)
 {
-  ParsedValue result;
+  ParsedValue result{};
 
   // Store the string value - the parsed structures may reference this.
   result.conf_value_storage = std::string(value);
diff --git a/src/proxy/shared/DiagsConfig.cc b/src/proxy/shared/DiagsConfig.cc
index 9e29be3d6c..9420f2df1f 100644
--- a/src/proxy/shared/DiagsConfig.cc
+++ b/src/proxy/shared/DiagsConfig.cc
@@ -42,7 +42,7 @@ void
 DiagsConfig::reconfigure_diags()
 {
   int              i;
-  DiagsConfigState c;
+  DiagsConfigState c{};
   bool             found, all_found;
 
   static struct {

Reply via email to