postgresql/contrib/fuzzystrmatch
Tom Lane 1d369c9e90 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 Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch. 2023-04-07 17:32:26 -04:00
Makefile Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch. 2023-04-07 17:32:26 -04:00
daitch_mokotoff.c Avoid using non-ASCII commentary in daitch_mokotoff.c. 2023-04-16 12:57:32 -04:00
daitch_mokotoff_header.pl Remove useless dependencies in daitch_mokotoff_header.pl. 2023-04-07 23:23:25 -04:00
dmetaphone.c Harmonize parameter names in contrib code. 2022-09-22 13:59:20 -07:00
fuzzystrmatch--1.0--1.1.sql Update fuzzystrmatch extension for parallel query. 2016-06-07 11:26:41 -04:00
fuzzystrmatch--1.1--1.2.sql Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch. 2023-04-07 17:32:26 -04:00
fuzzystrmatch--1.1.sql Update fuzzystrmatch extension for parallel query. 2016-06-07 11:26:41 -04:00
fuzzystrmatch.c Ensure Soundex difference() function handles empty input sanely. 2023-05-16 10:53:42 -04:00
fuzzystrmatch.control Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch. 2023-04-07 17:32:26 -04:00
meson.build Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch. 2023-04-07 17:32:26 -04:00