summaryrefslogtreecommitdiff
path: root/contrib/pg_visibility/pg_visibility.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-05-16 10:53:42 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-05-16 10:53:42 -0400
commit8084bf9a493d577bb2d0d902388ed3fd48859c05 (patch)
tree83b101430d6b71d19d5acddfe393bf7ec5a104f6 /contrib/pg_visibility/pg_visibility.c
parentf96e531b1c079ae148b927a204845c7150a573f8 (diff)
downloadpostgresql-REL_11_STABLE.tar.gz
Ensure Soundex difference() function handles empty input sanely.REL_11_STABLE
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
Diffstat (limited to 'contrib/pg_visibility/pg_visibility.c')
0 files changed, 0 insertions, 0 deletions