]> granicus.if.org Git - postgresql/commit
Fix string truncation to be multibyte-aware in text_name and bpchar_name.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 May 2012 21:35:05 +0000 (17:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 May 2012 21:35:05 +0000 (17:35 -0400)
commitd566ad3eb3e2ea532358123795f16fbeb5c0a46e
treea7b827e8a22e2b6ae93f632fafaa169b559c157e
parent965d76f972bec5595e84a8e8567636cb3ba7a1f2
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
src/backend/utils/adt/name.c
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varlena.c