This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.2.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit d64418cb6463b04a22bba2a6e74fcb3e9abeda59 Author: Masaori Koshiba <[email protected]> AuthorDate: Tue Jun 2 10:46:42 2026 +0900 Add length check in Doc::data_len() (#13133) (cherry picked from commit e78ed669c8b2edf8b255d8d0702abf2ed027dcbd) --- src/iocore/cache/P_CacheDoc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/iocore/cache/P_CacheDoc.h b/src/iocore/cache/P_CacheDoc.h index d501ca5308..8dc69a8cc5 100644 --- a/src/iocore/cache/P_CacheDoc.h +++ b/src/iocore/cache/P_CacheDoc.h @@ -82,6 +82,10 @@ Doc::prefix_len() const inline uint32_t Doc::data_len() const { + if (this->len <= sizeof(self_type) + this->hlen) { + return 0; + } + return this->len - sizeof(self_type) - this->hlen; }
