- Notifications
You must be signed in to change notification settings - Fork28
Commit873cb8f
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 parentd42c617 commit873cb8f
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 | |
---|---|---|---|
| |||
1667 | 1667 |
| |
1668 | 1668 |
| |
1669 | 1669 |
| |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
1670 | 1674 |
| |
1671 | 1675 |
| |
1672 | 1676 |
| |
| 1677 | + | |
| 1678 | + | |
1673 | 1679 |
| |
1674 | 1680 |
| |
1675 | 1681 |
| |
|
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)