| From: | Jeff Davis <jdavis(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: ltree/crc32.c: fix fragile code. |
| Date: | 2026-08-24 20:58:44 |
| Message-ID: | E1wybkh-00000001x7p-3eT2@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
ltree/crc32.c: fix fragile code.
Explicitly make space for the NUL when casefolding.
No known bug in the previous code, because the previous buffer (size
12) was more than large enough for folding any codepoint with enough
room left for a NUL. The builtin provider's limit is 7; ICU's limit
seems to be 7 also; and libc always does 1:1 mappings so the real
limit is MAX_MULTIBYTE_CHAR_LEN + 1 (size 5).
Reviewed-by: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Reviewed-by: Rithvika Devisetti <devisettirithvika(at)gmail(dot)com>
Discussion: https://postgr.es/m/2cfbc37ae8deccd3825e36b7f31c391cbf8ff9b8.camel@j-davis.com
Backpatch-through: 18
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/aea7bed4a755cab63fb667314a735b0ea3e6e688
Modified Files
--------------
contrib/ltree/crc32.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jeff Davis | 2026-08-24 20:58:51 | pgsql: ltree/crc32.c: fix fragile code. |
| Previous Message | Jeff Davis | 2026-08-24 18:57:26 | pgsql: Add C test function for pg_locale.h APIs. |