Code coverage for most pg_mblen* calls.
Thomas Munro <tmunro@postgresql.org>
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>
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_trgm/data/trgm_utf8.data | added | +50 −0 |
| contrib/pg_trgm/expected/pg_utf8_trgm_1.out | added | +3 −0 |
| contrib/pg_trgm/expected/pg_utf8_trgm.out | added | +8 −0 |
| contrib/pg_trgm/Makefile | modified | +1 −1 |
| contrib/pg_trgm/meson.build | modified | +1 −0 |
| contrib/pg_trgm/sql/pg_utf8_trgm.sql | added | +9 −0 |
| src/backend/utils/adt/arrayfuncs.c | modified | +6 −0 |
| src/test/regress/expected/encoding_1.out | added | +4 −0 |
| src/test/regress/expected/encoding.out | added | +401 −0 |
| src/test/regress/expected/euc_kr_1.out | added | +6 −0 |
| src/test/regress/expected/euc_kr.out | added | +16 −0 |
| src/test/regress/parallel_schedule | modified | +1 −1 |
| src/test/regress/regress.c | modified | +139 −0 |
| src/test/regress/sql/encoding.sql | added | +228 −0 |
| src/test/regress/sql/euc_kr.sql | added | +12 −0 |