- Notifications
You must be signed in to change notification settings - Fork28
Commit500d497
committed
Repair double-free in SP-GIST rescan (bug #15378)
spgrescan would first reset traversalCxt, and then traverse apotentially non-empty stack containing pointers to traversalValueswhich had been allocated in those contexts, freeing them a secondtime. This bug originates in commitccd6eb4 where traversalValue wasintroduced.Repair by traversing the stack before the context reset; this isn'tideal, since it means doing retail pfree in a context that's about tobe reset, but the freeing of a stack entry is also done in otherplaces in the code during the scan so it's not worth trying torefactor it further. Regression test added.Backpatch to 9.6 where the problem was introduced.Per bug #15378; analysis and patch by me, originally from a report onIRC by user velix; see also PostGIS ticket #4174; review by AlexanderKorotkov.Discussion:https://postgr.es/m/153663176628.23136.11901365223750051490@wrigleys.postgresql.org1 parent4fa3741 commit500d497
File tree
3 files changed
+40
-3
lines changed- src
- backend/access/spgist
- test/regress
- expected
- sql
3 files changed
+40
-3
lines changedLines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 |
| |
78 | 85 |
| |
79 | 86 |
| |
| |||
212 | 219 |
| |
213 | 220 |
| |
214 | 221 |
| |
215 |
| - | |
216 |
| - | |
217 |
| - | |
218 | 222 |
| |
219 | 223 |
| |
220 | 224 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
26 | 44 |
| |
27 | 45 |
| |
28 | 46 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
33 | 48 |
| |
34 | 49 |
| |
35 | 50 |
| |
|
0 commit comments
Comments
(0)