]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix shared memory size calculation on 64-bit systems (#520)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Tue, 17 Dec 2019 15:01:05 +0000 (15:01 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 3 Jan 2020 22:38:44 +0000 (11:38 +1300)
commita317ac7fa48b8d56b523f53560460cb9e725145a
tree0119bb066db0c93dfe213e1262e86105d63bb4d9
parentb47054d2f6859c31a5737872aa5a89200dc96728
Fix shared memory size calculation on 64-bit systems (#520)

Since commit 2253ee0, the wrong type (uint32 instead of size_t) was used
to calculate the PagePool::theLevels size. theLevels memory (positioned
by different and correct code) did not overlap with the raw pages
buffer, but the raw pages buffer could, in some cases, be 32 bits short,
placing the last 4 bytes of the last page outside of allocated memory.

In practice, shared memory allocations are page-aligned, and the
difference in 4 bytes was probably compensated by the extra allocated
bytes in most (or perhaps even all) cases.
src/ipc/mem/PageStack.cc