Commit 691594a
committed
Check for interrupts and stack overflow in TParserGet().
TParserGet() recurses for some token types, meaning it's possible
to drive it to stack overflow. Since this is a minority behavior,
I chose to add the check_stack_depth() call to the two places that
recurse rather than doing it during every single call.
While at it, add CHECK_FOR_INTERRUPTS(), because this can run
unpleasantly long for long inputs.
Per bug #17995 from Zuming Jiang. This is old, so back-patch
to all supported branches.
Discussion: https://postgr.es/m/17995-9f20ff3e6389db4c@postgresql.org1 parent 239fd11 commit 691594a
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
631 | 632 | | |
632 | 633 | | |
633 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
634 | 641 | | |
635 | 642 | | |
636 | 643 | | |
| |||
654 | 661 | | |
655 | 662 | | |
656 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
657 | 670 | | |
658 | 671 | | |
659 | 672 | | |
| |||
1697 | 1710 | | |
1698 | 1711 | | |
1699 | 1712 | | |
| 1713 | + | |
| 1714 | + | |
1700 | 1715 | | |
1701 | 1716 | | |
1702 | 1717 | | |
| |||
0 commit comments