Skip to content

Commit e78ed66

Browse files
authored
Add length check in Doc::data_len() (#13133)
1 parent afcf8d0 commit e78ed66

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/iocore/cache/P_CacheDoc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Doc::prefix_len() const
8282
inline uint32_t
8383
Doc::data_len() const
8484
{
85+
if (this->len <= sizeof(self_type) + this->hlen) {
86+
return 0;
87+
}
88+
8589
return this->len - sizeof(self_type) - this->hlen;
8690
}
8791

0 commit comments

Comments
 (0)