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

bneradt 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 5f6a83d1b9 Remove cache alternate vector detach (#13138)
5f6a83d1b9 is described below

commit 5f6a83d1b9adfc647af966960179c143ecbba234
Author: Brian Neradt <[email protected]>
AuthorDate: Tue May 12 10:54:45 2026 -0500

    Remove cache alternate vector detach (#13138)
    
    Cache alternate detach is a private helper with no current callers, and
    its compaction loop contains a latent out-of-bounds read if the helper is
    ever used. Keeping the dead path around preserves a future cache metadata
    hazard without providing any current behavior.
    
    This removes the unused helper and its declaration instead of repairing
    the unreachable implementation. Existing alternate removal continues to
    use the live remove path.
---
 src/iocore/cache/CacheHttp.cc  | 21 ---------------------
 src/iocore/cache/P_CacheHttp.h |  1 -
 2 files changed, 22 deletions(-)

diff --git a/src/iocore/cache/CacheHttp.cc b/src/iocore/cache/CacheHttp.cc
index b1d7b57f34..4c48db5adb 100644
--- a/src/iocore/cache/CacheHttp.cc
+++ b/src/iocore/cache/CacheHttp.cc
@@ -63,27 +63,6 @@ CacheHTTPInfoVector::insert(CacheHTTPInfo *info, int index)
   return index;
 }
 
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-void
-CacheHTTPInfoVector::detach(int idx, CacheHTTPInfo *r)
-{
-  int i;
-
-  ink_assert(idx >= 0);
-  ink_assert(idx < xcount);
-
-  r->copy_shallow(&data[idx].alternate);
-  data[idx].alternate.destroy();
-
-  for (i = idx; i < (xcount - 1); i++) {
-    data[i] = data[i + i];
-  }
-
-  xcount -= 1;
-}
-
 /*-------------------------------------------------------------------------
   -------------------------------------------------------------------------*/
 
diff --git a/src/iocore/cache/P_CacheHttp.h b/src/iocore/cache/P_CacheHttp.h
index 6a30b15b5e..77f8471320 100644
--- a/src/iocore/cache/P_CacheHttp.h
+++ b/src/iocore/cache/P_CacheHttp.h
@@ -50,7 +50,6 @@ struct CacheHTTPInfoVector {
   }
   int            insert(CacheHTTPInfo *info, int id = -1);
   CacheHTTPInfo *get(int idx);
-  void           detach(int idx, CacheHTTPInfo *r);
   void           remove(int idx, bool destroy);
   void           clear(bool destroy = true);
   void

Reply via email to