Fix small memory accounting bug in libpagestore (#9223)

Found while searching for other issues in shared memory.

The bug should be benign, in that it over-allocates memory for this
struct, but doesn't allow for out-of-bounds writes.
This commit is contained in:
Matthias van de Meent
2024-10-01 18:37:59 +02:00
committed by GitHub
parent 325de52e73
commit 6efdb1d0f3

View File

@@ -937,7 +937,7 @@ PagestoreShmemInit(void)
LWLockAcquire(AddinShmemInitLock, LW_EXCLUSIVE);
pagestore_shared = ShmemInitStruct("libpagestore shared state",
PagestoreShmemSize(),
sizeof(PagestoreShmemState),
&found);
if (!found)
{