Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2023-05-16 14:53:42 +0000
committerTom Lane2023-05-16 14:53:42 +0000
commit1d369c9e90f311ec98b07a259cac48c404c773d5 (patch)
treef4acf82756eee58cb7e1f7d4d1e14d6f80d59acc /src/backend/nodes/nodeFuncs.c
parent27debd05dcbdfe3db487ba82568f7f9ae25ddde2 (diff)
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 'src/backend/nodes/nodeFuncs.c')
0 files changed, 0 insertions, 0 deletions