forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0966291
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 parent3282e07 commit0966291
File tree
3 files changed
+15
-7
lines changed- contrib/fuzzystrmatch
- expected
- sql
3 files changed
+15
-7
lines changedLines changed: 6 additions & 0 deletions
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 |
| |
|
Lines changed: 8 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
729 | 729 |
| |
730 | 730 |
| |
731 | 731 |
| |
732 |
| - | |
733 |
| - | |
734 | 732 |
| |
735 |
| - | |
| 733 | + | |
736 | 734 |
| |
737 | 735 |
| |
738 |
| - | |
739 |
| - | |
| 736 | + | |
| 737 | + | |
740 | 738 |
| |
741 |
| - | |
| 739 | + | |
742 | 740 |
| |
743 | 741 |
| |
744 | 742 |
| |
| |||
751 | 749 |
| |
752 | 750 |
| |
753 | 751 |
| |
754 |
| - | |
| 752 | + | |
755 | 753 |
| |
756 | 754 |
| |
757 | 755 |
| |
| |||
768 | 766 |
| |
769 | 767 |
| |
770 | 768 |
| |
| 769 | + | |
| 770 | + | |
| 771 | + | |
771 | 772 |
| |
772 | 773 |
| |
773 | 774 |
| |
|
Lines changed: 1 addition & 0 deletions
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)