diff --git a/src/iocore/cache/P_CacheDoc.h b/src/iocore/cache/P_CacheDoc.h index d501ca5308b..8dc69a8cc59 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; }