forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitced138e
committed
Fix use-after-free bug with event triggers in an extension script
ALTER TABLE commands in an extension script are added to an eventtrigger command list; but starting with commitb5810de they do so ina memory context that's too short-lived, so when execution ends and timecomes to use the entries, they've already been freed.(This would also be a problem with ALTER TABLE commands in amulti-command query string, but these serendipitously end inPortalContext -- which probably explains why it took so long for this tobe reported.)Fix by using the memory context specifically set for that, instead.Backpatch to 13, where the aforementioned commit appeared.Reported-by: Philippe BeaudoinAuthor: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>Discussion:https://postgr.es/m/20200902193715.6e0269d4@firost1 parent10a5b35 commitced138e
File tree
7 files changed
+47
-2
lines changed- src
- backend/commands
- test/modules/test_extensions
- expected
- sql
7 files changed
+47
-2
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1646 | 1646 |
| |
1647 | 1647 |
| |
1648 | 1648 |
| |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
1649 | 1653 |
| |
1650 | 1654 |
| |
1651 | 1655 |
| |
| 1656 | + | |
| 1657 | + | |
1652 | 1658 |
| |
1653 | 1659 |
| |
1654 | 1660 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
11 |
| - | |
| 12 | + | |
| 13 | + | |
12 | 14 |
| |
13 | 15 |
| |
14 | 16 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
154 | 154 |
| |
155 | 155 |
| |
156 | 156 |
| |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + |
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + |
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + |
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + |
0 commit comments
Comments
(0)