pgsql: Fix string truncation to be multibyte-aware in text_name and bpc - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix string truncation to be multibyte-aware in text_name and bpc
Date
Msg-id E1SY2At-0001Mh-7P@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix string truncation to be multibyte-aware in text_name and bpchar_name.

Previously, casts to name could generate invalidly-encoded results.

Also, make these functions match namein() more exactly, by consistently
using palloc0() instead of ad-hoc zeroing code.

Back-patch to all supported branches.

Karl Schnaitter and Tom Lane

Branch
------
REL8_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6f163609bded024a2b5c4506745740695ecfc04f

Modified Files
--------------
src/backend/utils/adt/name.c    |   10 +++++++---
src/backend/utils/adt/varchar.c |   14 ++++----------
src/backend/utils/adt/varlena.c |   12 +++---------
3 files changed, 14 insertions(+), 22 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix string truncation to be multibyte-aware in text_name and bpc
Next
From: Tom Lane
Date:
Subject: pgsql: Fix string truncation to be multibyte-aware in text_name and bpc