forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7f69ed4
committed
pg_trgm: fix crash in 2-item picksplit
Whether from size overflow in gistSplit or from secondary splits,picksplit is (rarely) called with exactly two items to split.Formerly, due to special-case handling of the last item, this wouldlead to access to an uninitialized cache entry; prior to PG 13 thismight have been harmless or at worst led to an incorrect union datum,but in 13 onwards it can cause a backend crash from using anuninitialized pointer.Repair by removing the special case, which was deemed not to have beenappropriate anyway. Backpatch all the way, because this bug hasexisted since pg_trgm was added.Per report on IRC from user "ftzdomino". Analysis and testing by me,patch from Alexander Korotkov.Discussion:https://postgr.es/m/87k0usfdxg.fsf@news-spur.riddles.org.uk1 parent0d0626e commit7f69ed4
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
| 763 | + | |
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
786 | | - | |
| 786 | + | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | | - | |
| 813 | + | |
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| |||
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
849 | | - | |
850 | | - | |
| 849 | + | |
851 | 850 | | |
852 | 851 | | |
853 | 852 | | |
| |||
933 | 932 | | |
934 | 933 | | |
935 | 934 | | |
936 | | - | |
937 | 935 | | |
938 | 936 | | |
939 | 937 | | |
| |||
0 commit comments
Comments
(0)