aboutsummaryrefslogtreecommitdiff
path: root/contrib/intarray/_int_gist.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
commit0966291a4ade47f7c14313ab7868d1de4e4f6688 (patch)
tree9c4e818440f34d755c89bf31316a2f2f6cf7de4c /contrib/intarray/_int_gist.c
parent3282e071bc594923f5d5f09c6f5b548e425a558a (diff)
downloadpostgresql-0966291a4ade47f7c14313ab7868d1de4e4f6688.tar.gz
postgresql-0966291a4ade47f7c14313ab7868d1de4e4f6688.zip
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
Diffstat (limited to 'contrib/intarray/_int_gist.c')
0 files changed, 0 insertions, 0 deletions