to_char():  prevent accesses beyond the allocated buffer
to_char():  prevent accesses beyond the allocated buffer

Previously very long field masks for floats could access memory
beyond the existing buffer allocated to hold the result.

Reported by Andres Freund and Peter Geoghegan.	Backpatch to all
supported versions.

Security: CVE-2015-0241

zeroae/postgres-xl,lisakowen/gpdb,greenplum-db/gpdb,adam8157/gpdb,oberstet/postgres-xl,adam8157/gpdb,50wu/gpdb,ovr/postgres-xl,ashwinstar/gpdb,yazun/postgres-xl,ashwinstar/gpdb,50wu/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,lisakowen/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,oberstet/postgres-xl,oberstet/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,lisakowen/gpdb,ovr/postgres-xl,yazun/postgres-xl,adam8157/gpdb,pavanvd/postgres-xl,Postgres-XL/Postgres-XL,50wu/gpdb,yazun/postgres-xl,ovr/postgres-xl,yazun/postgres-xl,50wu/gpdb,zeroae/postgres-xl,zeroae/postgres-xl,xinzweb/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,greenplum-db/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,techdragon/Postgres-XL,ovr/postgres-xl,yazun/postgres-xl,lisakowen/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,xinzweb/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,jmcatamney/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,zeroae/postgres-xl,lisakowen/gpdb,50wu/gpdb,jmcatamney/gpdb,50wu/gpdb,ovr/postgres-xl,adam8157/gpdb,pavanvd/postgres-xl,pavanvd/postgres-xl,jmcatamney/gpdb,50wu/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,techdragon/Postgres-XL,adam8157/gpdb,Postgres-XL/Postgres-XL,jmcatamney/gpdb,xinzweb/gpdb,ashwinstar/gpdb,xinzweb/gpdb,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,adam8157/gpdb,ashwinstar/gpdb,adam8157/gpdb