pgsql: Fix expanding 'bounds' in pg_trgm's calc_word_similarity() funct - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Fix expanding 'bounds' in pg_trgm's calc_word_similarity() funct
Date
Msg-id E1vtNGh-000IAC-24@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix expanding 'bounds' in pg_trgm's calc_word_similarity() function

If the 'bounds' array needs to be expanded, because the input contains
more trigrams than the initial guess, the code didn't return the
reallocated array correctly to the caller. That could lead to a crash
in the rare case that the input string becomes longer when it's
lower-cased. The only known instance of that is when an ICU locale is
used with certain single-byte encodings. This was an oversight in
commit 00896ddaf41f.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/18bcdb75d155e68a9cb34b5b76d0bccd0a234110

Modified Files
--------------
contrib/pg_trgm/trgm_op.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Richard Guo
Date:
Subject: pgsql: Fix computation of varnullingrels when translating appendrel Var
Next
From: Nathan Bossart
Date:
Subject: pgsql: Speedup COPY FROM with additional function inlining.