public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thomas Munro <[email protected]>
To: [email protected]
Subject: pgsql: Fix mb2wchar functions on short input.
Date: Mon, 09 Feb 2026 00:07:34 +0000
Message-ID: <[email protected]> (raw)

Fix mb2wchar functions on short input.

When converting multibyte to pg_wchar, the UTF-8 implementation would
silently ignore an incomplete final character, while the other
implementations would cast a single byte to pg_wchar, and then repeat
for the remaining byte sequence.  While it didn't overrun the buffer, it
was surely garbage output.

Make all encodings behave like the UTF-8 implementation.  A later change
for master only will convert this to an error, but we choose not to
back-patch that behavior change on the off-chance that someone is
relying on the existing UTF-8 behavior.

Security: CVE-2026-2006
Backpatch-through: 14
Author: Thomas Munro <[email protected]>
Reported-by: Noah Misch <[email protected]>
Reviewed-by: Noah Misch <[email protected]>
Reviewed-by: Heikki Linnakangas <[email protected]>

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7a522039f7010ea9ec45dcbf11a4038dce240bb3

Modified Files
--------------
src/common/wchar.c | 52 ++++++++++++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 20 deletions(-)



view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Fix mb2wchar functions on short input.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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