bneradt commented on code in PR #14120:
URL: https://github.com/apache/trafficserver/pull/14120#discussion_r4683167508
##########
src/traffic_cache_tool/CacheScan.cc:
##########
@@ -380,15 +380,18 @@ CacheScan::unmarshal(char *buf, int len, RefCountObj
*block_ref, ts::VersionNumb
bool
CacheScan::check_url(swoc::MemSpan<char> &mem, URLImpl *url)
{
+ if (url == nullptr || !mem.contains(reinterpret_cast<char *>(url))) {
Review Comment:
**[P2] Check that the whole URL fits before reading it.**
`MemSpan::contains()` checks a single address. A truncated URL can start inside
`doc_mem` while `m_ptr_scheme` and other fields extend beyond it. Check
alignment and the full `sizeof(URLImpl)` range before reading fields. The
component spans passed to `bwprint()` also need their lengths checked against
the document before formatting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]