pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Ensure Soundex difference() function handles empty input sanely. 6+ messages / 1 participants [nested] [flat]
* pgsql: Ensure Soundex difference() function handles empty input sanely. @ 2023-05-16 14:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-05-16 14:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ccd3623256220b944d9da00df75d91ef4d550362 Modified Files -------------- contrib/fuzzystrmatch/expected/fuzzystrmatch.out | 6 ++++++ contrib/fuzzystrmatch/fuzzystrmatch.c | 15 ++++++++------- contrib/fuzzystrmatch/sql/fuzzystrmatch.sql | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure Soundex difference() function handles empty input sanely. @ 2023-05-16 14:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-05-16 14:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8084bf9a493d577bb2d0d902388ed3fd48859c05 Modified Files -------------- contrib/fuzzystrmatch/expected/fuzzystrmatch.out | 6 ++++++ contrib/fuzzystrmatch/fuzzystrmatch.c | 15 ++++++++------- contrib/fuzzystrmatch/sql/fuzzystrmatch.sql | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure Soundex difference() function handles empty input sanely. @ 2023-05-16 14:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-05-16 14:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/1d369c9e90f311ec98b07a259cac48c404c773d5 Modified Files -------------- contrib/fuzzystrmatch/expected/fuzzystrmatch.out | 6 ++++++ contrib/fuzzystrmatch/fuzzystrmatch.c | 15 ++++++++------- contrib/fuzzystrmatch/sql/fuzzystrmatch.sql | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure Soundex difference() function handles empty input sanely. @ 2023-05-16 14:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-05-16 14:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0966291a4ade47f7c14313ab7868d1de4e4f6688 Modified Files -------------- contrib/fuzzystrmatch/expected/fuzzystrmatch.out | 6 ++++++ contrib/fuzzystrmatch/fuzzystrmatch.c | 15 ++++++++------- contrib/fuzzystrmatch/sql/fuzzystrmatch.sql | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure Soundex difference() function handles empty input sanely. @ 2023-05-16 14:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-05-16 14:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0409c7fc746b2597edeaab3132d3f3554660283d Modified Files -------------- contrib/fuzzystrmatch/expected/fuzzystrmatch.out | 6 ++++++ contrib/fuzzystrmatch/fuzzystrmatch.c | 15 ++++++++------- contrib/fuzzystrmatch/sql/fuzzystrmatch.sql | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure Soundex difference() function handles empty input sanely. @ 2023-05-16 14:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-05-16 14:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/eaf99e4c4ae4084b8261e5e1f9c2c93004a98638 Modified Files -------------- contrib/fuzzystrmatch/expected/fuzzystrmatch.out | 6 ++++++ contrib/fuzzystrmatch/fuzzystrmatch.c | 15 ++++++++------- contrib/fuzzystrmatch/sql/fuzzystrmatch.sql | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-05-16 14:54 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-05-16 14:54 pgsql: Ensure Soundex difference() function handles empty input sanely. Tom Lane <tgl@sss.pgh.pa.us> 2023-05-16 14:54 pgsql: Ensure Soundex difference() function handles empty input sanely. Tom Lane <tgl@sss.pgh.pa.us> 2023-05-16 14:54 pgsql: Ensure Soundex difference() function handles empty input sanely. Tom Lane <tgl@sss.pgh.pa.us> 2023-05-16 14:54 pgsql: Ensure Soundex difference() function handles empty input sanely. Tom Lane <tgl@sss.pgh.pa.us> 2023-05-16 14:54 pgsql: Ensure Soundex difference() function handles empty input sanely. Tom Lane <tgl@sss.pgh.pa.us> 2023-05-16 14:54 pgsql: Ensure Soundex difference() function handles empty input sanely. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox