]> git.ipfire.org Git - thirdparty/squid.git/commit
Improve Ipc::Mem page limits accounting (#1030)
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 26 Apr 2022 19:55:36 +0000 (19:55 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 27 Apr 2022 13:29:42 +0000 (13:29 +0000)
commit9d7dcd17b0f718cfb545b0007f8e7742f8cf791d
tree62ef35a4d329822ea77c3f26afd0898e4266bcd2
parent0efecd3284dbeb24436e22f8273b698a985bdc38
Improve Ipc::Mem page limits accounting (#1030)

Undocumented Ipc::Mem::PageId::maxPurpose is used to mark freed pages.
Freed pages do not participate in estimating future memory needs, so the
Limits array does not need to store their needs. However, some of the
needs estimation code is written without that assumption in mind because
maxPurpose is a legitimate/used purpose value (rather than an enum end
marker). This change improves this code in case our assumption change.

Detected by Coverity:
* CID 1504262: Out-of-bounds write (OVERRUN)
* CID 1504263: Out-of-bounds read (OVERRUN)
src/ipc/mem/Pages.cc