Fix off-by-one in memory allocation for quote_literal_cstr().
Fix off-by-one in memory allocation for quote_literal_cstr().

The calculation didn't take into account the NULL terminator. That lead
to overwriting the palloc'd buffer by one byte, if the input consists
entirely of backslashes. For example "format('%L', E'\\')".

Fixes bug #14468. Backpatch to all supported versions.

Report: https://www.postgresql.org/message-id/20161216105001.13334.42819%40wrigleys.postgresql.org

lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,50wu/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,xinzweb/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,adam8157/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,50wu/gpdb,adam8157/gpdb,jmcatamney/gpdb,xinzweb/gpdb,xinzweb/gpdb,xinzweb/gpdb,ashwinstar/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,lisakowen/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,ashwinstar/gpdb,50wu/gpdb,jmcatamney/gpdb,xinzweb/gpdb,lisakowen/gpdb,lisakowen/gpdb,adam8157/gpdb,adam8157/gpdb,lisakowen/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,50wu/gpdb,greenplum-db/gpdb,50wu/gpdb