forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit49a4508

Richard Guo
Fix unsafe access to BufferDescriptors
When considering a local buffer, the GetBufferDescriptor() call inBufferGetLSNAtomic() would be retrieving a shared buffer with a badbuffer ID. Since the code checks whether the buffer is shared beforeusing the retrieved BufferDesc, this issue did not lead to anymalfunction. Nonetheless this seems like trouble waiting to happen,so fix it by ensuring that GetBufferDescriptor() is only called whenwe 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.comBackpatch-through: 131 parent727bc6a commit49a4508
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3973 | 3973 |
| |
3974 | 3974 |
| |
3975 | 3975 |
| |
3976 |
| - | |
3977 | 3976 |
| |
| 3977 | + | |
3978 | 3978 |
| |
3979 | 3979 |
| |
3980 | 3980 |
| |
| |||
3988 | 3988 |
| |
3989 | 3989 |
| |
3990 | 3990 |
| |
| 3991 | + | |
3991 | 3992 |
| |
3992 | 3993 |
| |
3993 | 3994 |
| |
|
0 commit comments
Comments
(0)