]> 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:34:58 +0000 (17:34 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 May 2012 21:34:58 +0000 (17:34 -0400)
commit71e985a07a7ae9319c00629f319a4c30a9e32fd6
tree799ad8663378732f9346e4db8b6a06507c0659e6
parent1a93588ffcad3e4876c9610c0a35d79c7fcdeffe
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