]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Code coverage for most pg_mblen* calls.
authorThomas Munro <tmunro@postgresql.org>
Sun, 11 Jan 2026 21:20:06 +0000 (10:20 +1300)
committerThomas Munro <tmunro@postgresql.org>
Sun, 8 Feb 2026 23:44:12 +0000 (12:44 +1300)
commitc67bef3f3252a3a38bf347f9f119944176a796ce
treea251e4f1e7a201ed12a0323477bb69581d471a9e
parent1e7fe06c10c0a8da9dd6261a6be8d405dc17c728
Code coverage for most pg_mblen* calls.

A security patch changed them today, so close the coverage gap now.
Test that buffer overrun is avoided when pg_mblen*() requires more
than the number of bytes remaining.

This does not cover the calls in dict_thesaurus.c or in dict_synonym.c.
That code is straightforward.  To change that code's input, one must
have access to modify installed OS files, so low-privilege users are not
a threat.  Testing this would likewise require changing installed
share/postgresql/tsearch_data, which was enough of an obstacle to not
bother.

Security: CVE-2026-2006
Backpatch-through: 14
Co-authored-by: Thomas Munro <thomas.munro@gmail.com>
Co-authored-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
17 files changed:
contrib/pg_trgm/Makefile
contrib/pg_trgm/data/trgm_utf8.data [new file with mode: 0644]
contrib/pg_trgm/expected/pg_utf8_trgm.out [new file with mode: 0644]
contrib/pg_trgm/expected/pg_utf8_trgm_1.out [new file with mode: 0644]
contrib/pg_trgm/meson.build
contrib/pg_trgm/sql/pg_utf8_trgm.sql [new file with mode: 0644]
src/backend/utils/adt/arrayfuncs.c
src/test/regress/expected/copyencoding.out
src/test/regress/expected/encoding.out [new file with mode: 0644]
src/test/regress/expected/encoding_1.out [new file with mode: 0644]
src/test/regress/expected/euc_kr.out [new file with mode: 0644]
src/test/regress/expected/euc_kr_1.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/regress.c
src/test/regress/sql/copyencoding.sql
src/test/regress/sql/encoding.sql [new file with mode: 0644]
src/test/regress/sql/euc_kr.sql [new file with mode: 0644]