]> 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:24 +0000 (17:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 May 2012 21:35:24 +0000 (17:35 -0400)
commit6f163609bded024a2b5c4506745740695ecfc04f
tree8ba85c57f8c97acc8f16916ccdbfc600b6f215bb
parentbd43c50a5bd560224f996d6bd14e1e3cb5a5b06b
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