postgresql/contrib/fuzzystrmatch
Tom Lane ccd3623256 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 Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
dmetaphone.c Clean up newlines following left parentheses 2020-01-30 13:42:14 -03: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.c Ensure Soundex difference() function handles empty input sanely. 2023-05-16 10:53:42 -04:00
fuzzystrmatch.control Mark some contrib modules as "trusted". 2020-02-13 15:02:35 -05:00