Skip to content

Commit fd45d16

Browse files
committed
Fix wrong allocation size in c8f621c.
In c8f621c I forgot to account for MAXALIGN when allocating a new tuplebuf in ReorderBufferGetTupleBuf(). That happens to currently not cause active problems on a number of platforms because the affected pointer is already aligned, but others, like ppc and hppa, trigger this in the regression test, due to a debug memset clearing memory. Fix that. Backpatch: 9.4, like the previous commit.
1 parent b3e0509 commit fd45d16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/replication/logical/reorderbuffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ ReorderBufferGetTupleBuf(ReorderBuffer *rb, Size tuple_len)
483483
{
484484
tuple = (ReorderBufferTupleBuf *)
485485
MemoryContextAlloc(rb->context,
486-
sizeof(ReorderBufferTupleBuf) + alloc_len);
486+
sizeof(ReorderBufferTupleBuf) +
487+
MAXIMUM_ALIGNOF + alloc_len);
487488
tuple->alloc_tuple_size = alloc_len;
488489
tuple->tuple.t_data = ReorderBufferTupleBufData(tuple);
489490
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy