postgresql/contrib/pg_trgm
Heikki Linnakangas 18bcdb75d1 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 00896ddaf4.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Backpatch-through: 18
2026-02-20 11:56:42 +02:00
..
data Code coverage for most pg_mblen* calls. 2026-02-09 12:44:12 +13:00
expected Code coverage for most pg_mblen* calls. 2026-02-09 12:44:12 +13:00
sql Code coverage for most pg_mblen* calls. 2026-02-09 12:44:12 +13:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Code coverage for most pg_mblen* calls. 2026-02-09 12:44:12 +13:00
meson.build Code coverage for most pg_mblen* calls. 2026-02-09 12:44:12 +13:00
pg_trgm--1.0--1.1.sql Fix typo in update scripts for some contrib modules. 2013-07-19 04:13:01 +09:00
pg_trgm--1.1--1.2.sql Add word_similarity to pg_trgm contrib module. 2016-03-16 18:59:21 +03:00
pg_trgm--1.2--1.3.sql Make contrib modules' installation scripts more secure. 2020-08-10 10:44:42 -04:00
pg_trgm--1.3--1.4.sql Add strict_word_similarity to pg_trgm module 2018-03-21 14:57:42 +03:00
pg_trgm--1.3.sql Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
pg_trgm--1.4--1.5.sql Fix typo in contrib/pg_trgm/pg_trgm--1.4--1.5.sql 2020-11-12 08:55:09 +03:00
pg_trgm--1.5--1.6.sql Handle equality operator in contrib/pg_trgm 2020-11-15 08:52:35 +03:00
pg_trgm.control Handle equality operator in contrib/pg_trgm 2020-11-15 08:52:35 +03:00
trgm.h Replace pg_mblen() with bounds-checked versions. 2026-02-09 12:44:04 +13:00
trgm_gin.c Use fallthrough attribute instead of comment 2026-02-19 08:51:12 +01:00
trgm_gist.c Use fallthrough attribute instead of comment 2026-02-19 08:51:12 +01:00
trgm_op.c Fix expanding 'bounds' in pg_trgm's calc_word_similarity() function 2026-02-20 11:56:42 +02:00
trgm_regexp.c Replace pg_mblen() with bounds-checked versions. 2026-02-09 12:44:04 +13:00