Skip site navigation (1) Skip section navigation (2)

pgsql: Fix string truncation to be multibyte-aware in text_name andbpc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix string truncation to be multibyte-aware in text_name andbpc
Date: 2012-05-25 21:35:55
Message-ID: E1SY2At-0001MZ-3I@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: 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
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/71e985a07a7ae9319c00629f319a4c30a9e32fd6

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

Next:From: Tom LaneDate: 2012-05-26 23:10:52
Subject: pgsql: Prevent synchronized scanning when systable_beginscan choosesa
Previous:From: Tom LaneDate: 2012-05-25 18:36:37
Subject: pgsql: Use binary search instead of brute-force scan infindNamespace()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group