postgresql/src
Thomas Munro 74ee636cc9 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 <thomas.munro@gmail.com>
Reported-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
2026-02-09 12:08:58 +13:00
..
backend Replace some hard-wired OID constants with corresponding macros. 2026-02-07 23:15:20 -05:00
bin Further error message fix 2026-02-07 22:37:02 +01:00
common Fix mb2wchar functions on short input. 2026-02-09 12:08:58 +13:00
fe_utils Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
include Future-proof sort template against undefined behavior 2026-02-07 17:02:35 +07:00
interfaces libpq: Prepare for protocol grease during 19beta 2026-02-06 10:31:45 -08:00
makefiles tests: Add a test C++ extension module 2026-01-20 16:42:30 +01:00
pl Refactor att_align_nominal() to improve performance. 2026-02-02 14:39:50 -05:00
port Fix accidentally cast away qualifiers 2026-01-26 16:02:31 +01:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test Fix logical replication TAP test to read publisher log correctly. 2026-02-05 00:43:06 +09:00
timezone Update time zone data files to tzdata release 2025c. 2026-01-18 14:54:33 -05:00
tools Fix buffer overflows in pg_trgm due to lower-casing 2026-02-09 12:08:58 +13:00
tutorial Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in tests: Add a test C++ extension module 2026-01-20 16:42:30 +01:00
Makefile.shlib
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00