This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 8471a90888e9e1137824d600e485a612a6e7a407 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. (cherry picked from commit 5f6a83d1b9adfc647af966960179c143ecbba234) --- 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 89c92d9078..808534c033 100644 --- a/src/iocore/cache/P_CacheHttp.h +++ b/src/iocore/cache/P_CacheHttp.h @@ -55,7 +55,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
