pgsql: Use palloc_array() in pltcl and plperl to avoid overflow

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use palloc_array() in pltcl and plperl to avoid overflow
Date: 2026-08-10 13:41:29
Message-ID: E1wtQFt-00000000yGd-26DW@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use palloc_array() in pltcl and plperl to avoid overflow

Some of these could overflow on 32-bit systems with the right input.
Convert all cases where we called palloc() with multiplication to fix
them. Not all of them were bugs, but it's better to be safe than
sorry.

Reported-by: Tulya Project, Team Dhiutsa, Bitecope Technologies Private Ltd
Backpatch-through: 14
Security: CVE-2026-14677

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8bbdc054043af64add7ac4ec544efb1219d9901d
Author: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>

Modified Files
--------------
src/pl/plperl/SPI.xs | 6 +++---
src/pl/plperl/plperl.c | 38 +++++++++++++++++++-------------------
src/pl/tcl/pltcl.c | 20 ++++++++++----------
3 files changed, 32 insertions(+), 32 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2026-08-10 13:41:30 pgsql: Reject calls from SQL to functions that take or return type inte
Previous Message Noah Misch 2026-08-10 13:41:28 pgsql: Harden tsvector code against overflows.