pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: ltree/crc32.c: fix fragile code.
3+ messages / 1 participants
[nested] [flat]

* pgsql: ltree/crc32.c: fix fragile code.
@ 2026-08-24 20:58 Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Jeff Davis @ 2026-08-24 20:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@iki.fi>
Reviewed-by: Rithvika Devisetti <devisettirithvika@gmail.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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: ltree/crc32.c: fix fragile code.
@ 2026-08-24 20:58 Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Jeff Davis @ 2026-08-24 20:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@iki.fi>
Reviewed-by: Rithvika Devisetti <devisettirithvika@gmail.com>
Discussion: https://postgr.es/m/2cfbc37ae8deccd3825e36b7f31c391cbf8ff9b8.camel@j-davis.com
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5ce1cf485c2382fdd40ce54a0a39bece8f67b451

Modified Files
--------------
contrib/ltree/crc32.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: ltree/crc32.c: fix fragile code.
@ 2026-08-24 20:58 Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Jeff Davis @ 2026-08-24 20:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@iki.fi>
Reviewed-by: Rithvika Devisetti <devisettirithvika@gmail.com>
Discussion: https://postgr.es/m/2cfbc37ae8deccd3825e36b7f31c391cbf8ff9b8.camel@j-davis.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8fa803dd695073a6fad49c49878b46783ac2f207

Modified Files
--------------
contrib/ltree/crc32.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-08-24 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-24 20:58 pgsql: ltree/crc32.c: fix fragile code. Jeff Davis <jdavis@postgresql.org>
2026-08-24 20:58 pgsql: ltree/crc32.c: fix fragile code. Jeff Davis <jdavis@postgresql.org>
2026-08-24 20:58 pgsql: ltree/crc32.c: fix fragile code. Jeff Davis <jdavis@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox