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

masaori335 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 e78ed669c8 Add length check in Doc::data_len() (#13133)
e78ed669c8 is described below

commit e78ed669c8b2edf8b255d8d0702abf2ed027dcbd
Author: Masaori Koshiba <[email protected]>
AuthorDate: Tue Jun 2 10:46:42 2026 +0900

    Add length check in Doc::data_len() (#13133)
---
 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;
 }
 

Reply via email to