postgresql/contrib/fuzzystrmatch
Tom Lane 0966291a4a 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 for
the case of a string containing no alphabetic characters, resulting
in unstable output and Valgrind complaints.

Fix by using memset() to fill the whole buffer in the early-exit
case.  Also make some cosmetic improvements (I didn't care for the
random 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.org
2023-05-16 10:53:42 -04:00
..
expected Ensure Soundex difference() function handles empty input sanely. 2023-05-16 10:53:42 -04:00
sql Ensure Soundex difference() function handles empty input sanely. 2023-05-16 10:53:42 -04:00
.gitignore fuzzystrmatch: Add test suite 2017-09-14 22:22:59 -04:00
Makefile fuzzystrmatch: Add test suite 2017-09-14 22:22:59 -04:00
dmetaphone.c Replace search.cpan.org with metacpan.org 2018-06-29 22:02:20 +09:00
fuzzystrmatch--1.0--1.1.sql Update fuzzystrmatch extension for parallel query. 2016-06-07 11:26:41 -04:00
fuzzystrmatch--1.1.sql Update fuzzystrmatch extension for parallel query. 2016-06-07 11:26:41 -04:00
fuzzystrmatch--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
fuzzystrmatch.c Ensure Soundex difference() function handles empty input sanely. 2023-05-16 10:53:42 -04:00
fuzzystrmatch.control Update fuzzystrmatch extension for parallel query. 2016-06-07 11:26:41 -04:00