forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitccd3623
committed
Ensure Soundex difference() function handles empty input sanely.
fuzzystrmatch's difference() function assumes that _soundex()always initializes its output buffer fully. This was not so forthe case of a string containing no alphabetic characters, resultingin unstable output and Valgrind complaints.Fix by using memset() to fill the whole buffer in the early-exitcase. Also make some cosmetic improvements (I didn't care for therandom switches between "instr[0]" and "*instr" notation).Report and diagnosis by Alexander Lakhin (bug #17935).Back-patch to all supported branches.Discussion:https://postgr.es/m/17935-b99316aa79c18513@postgresql.org1 parent7deeb02 commitccd3623
File tree
3 files changed
+15
-7
lines changed- contrib/fuzzystrmatch
- expected
- sql
3 files changed
+15
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
730 | | - | |
731 | | - | |
732 | 730 | | |
733 | | - | |
| 731 | + | |
734 | 732 | | |
735 | 733 | | |
736 | | - | |
737 | | - | |
| 734 | + | |
| 735 | + | |
738 | 736 | | |
739 | | - | |
| 737 | + | |
740 | 738 | | |
741 | 739 | | |
742 | 740 | | |
| |||
749 | 747 | | |
750 | 748 | | |
751 | 749 | | |
752 | | - | |
| 750 | + | |
753 | 751 | | |
754 | 752 | | |
755 | 753 | | |
| |||
766 | 764 | | |
767 | 765 | | |
768 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
769 | 770 | | |
770 | 771 | | |
771 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments
Comments
(0)