Content-Length: 261439 | pFad | http://github.com/postgrespro/postgres/commit/308985b0b404a5891a1a629f38cc46c2b2dcb4be

BB Fix dangling pointer problem in ReorderBufferSerializeChange. · postgrespro/postgres@308985b · GitHub
Skip to content

Commit 308985b

Browse files
committed
Fix dangling pointer problem in ReorderBufferSerializeChange.
Commit 3fe3511 introduced a new case into this function, but neglected to ensure that the "ondisk" pointer got updated after a possible reallocation as the code does in other cases. Stas Kelvich, per diagnosis by Konstantin Knizhnik.
1 parent babe05b commit 308985b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/replication/logical/reorderbuffer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,6 +2250,9 @@ ReorderBufferSerializeChange(ReorderBuffer *rb, ReorderBufferTXN *txn,
22502250

22512251
data = ((char *) rb->outbuf) + sizeof(ReorderBufferDiskChange);
22522252

2253+
/* might have been reallocated above */
2254+
ondisk = (ReorderBufferDiskChange *) rb->outbuf;
2255+
22532256
/* write the prefix including the size */
22542257
memcpy(data, &prefix_size, sizeof(Size));
22552258
data += sizeof(Size);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/308985b0b404a5891a1a629f38cc46c2b2dcb4be

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy