forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2d1f152
committed
Defend against stack overrun in a few more places.
SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c,and regex_selectivity_sub() in selectivity estimation could recurseuntil stack overflow; fix by adding check_stack_depth() calls.So could next() in the regex compiler, but that case is better fixed byconverting its tail recursion to a loop. (We probably get better codethat way too, since next() can now be inlined into its sole caller.)There remains a reachable stack overrun in the Turkish stemmer, butwe'll need some advice from the Snowball people about how to fix that.Per report from Egor Chindyaskin and Alexander Lakhin. These mistakesare old, so back-patch to all supported branches.Richard Guo and Tom LaneDiscussion:https://postgr.es/m/1661334672.728714027@f473.i.mail.ru1 parent3ccdeff commit2d1f152
File tree
4 files changed
+14
-2
lines changed- src/backend
- regex
- tsearch
- utils/adt
4 files changed
+14
-2
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
278 | 278 |
| |
279 | 279 |
| |
280 | 280 |
| |
| 281 | + | |
| 282 | + | |
281 | 283 |
| |
282 | 284 |
| |
283 | 285 |
| |
| |||
595 | 597 |
| |
596 | 598 |
| |
597 | 599 |
| |
598 |
| - | |
599 |
| - | |
| 600 | + | |
600 | 601 |
| |
601 | 602 |
| |
602 | 603 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
| |||
2399 | 2400 |
| |
2400 | 2401 |
| |
2401 | 2402 |
| |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
2402 | 2406 |
| |
2403 | 2407 |
| |
2404 | 2408 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3907 | 3907 |
| |
3908 | 3908 |
| |
3909 | 3909 |
| |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
3910 | 3913 |
| |
3911 | 3914 |
| |
3912 | 3915 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
| 47 | + | |
47 | 48 |
| |
48 | 49 |
| |
49 | 50 |
| |
| |||
1338 | 1339 |
| |
1339 | 1340 |
| |
1340 | 1341 |
| |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
1341 | 1345 |
| |
1342 | 1346 |
| |
1343 | 1347 |
| |
|
0 commit comments
Comments
(0)