aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorRichard Guo <rguo@postgresql.org>2025-02-19 11:05:35 +0900
committerRichard Guo <rguo@postgresql.org>2025-02-19 11:05:35 +0900
commit71d02dc478d574c75bd0af82cec774c7b9059a61 (patch)
tree8dd41622bc04fcde9b4cf10fb605948ed513515f /src/backend/parser/parse_utilcmd.c
parentc39392ebaeeff7dafbc255844bcc605aaef01d7d (diff)
downloadpostgresql-71d02dc478d574c75bd0af82cec774c7b9059a61.tar.gz
postgresql-71d02dc478d574c75bd0af82cec774c7b9059a61.zip
Fix unsafe access to BufferDescriptors
When considering a local buffer, the GetBufferDescriptor() call in BufferGetLSNAtomic() would be retrieving a shared buffer with a bad buffer ID. Since the code checks whether the buffer is shared before using the retrieved BufferDesc, this issue did not lead to any malfunction. Nonetheless this seems like trouble waiting to happen, so fix it by ensuring that GetBufferDescriptor() is only called when we know the buffer is shared. Author: Tender Wang <tndrwang@gmail.com> Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com> Reviewed-by: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CAHewXNku-o46-9cmUgyv6LkSZ25doDrWq32p=oz9kfD8ovVJMg@mail.gmail.com Backpatch-through: 13
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions