- Notifications
You must be signed in to change notification settings - Fork28
Commit48ab1fa
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 parent6058f22 commit48ab1fa
1 file changed
+4
-8
lines changedLines changed: 4 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
786 | 786 |
| |
787 | 787 |
| |
788 | 788 |
| |
789 |
| - | |
| 789 | + | |
790 | 790 |
| |
791 | 791 |
| |
792 | 792 |
| |
| |||
811 | 811 |
| |
812 | 812 |
| |
813 | 813 |
| |
814 |
| - | |
815 |
| - | |
| 814 | + | |
| 815 | + | |
816 | 816 |
| |
817 | 817 |
| |
818 | 818 |
| |
| |||
841 | 841 |
| |
842 | 842 |
| |
843 | 843 |
| |
844 |
| - | |
| 844 | + | |
845 | 845 |
| |
846 | 846 |
| |
847 | 847 |
| |
| |||
853 | 853 |
| |
854 | 854 |
| |
855 | 855 |
| |
856 |
| - | |
857 |
| - | |
858 |
| - | |
859 | 856 |
| |
860 | 857 |
| |
861 | 858 |
| |
| |||
944 | 941 |
| |
945 | 942 |
| |
946 | 943 |
| |
947 |
| - | |
948 | 944 |
| |
949 | 945 |
| |
950 | 946 |
| |
|
0 commit comments
Comments
(0)