Fix undersized result buffer in pset_quoted_string().

Tom Lane <tgl@sss.pgh.pa.us>

Commit: c53a82b99d98df393d7ba308bf1586b2201d0d65
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2014-10-26T23:17:57Z
Releases: 9.4.0
Fix undersized result buffer in pset_quoted_string().

The malloc request was 1 byte too small for the worst-case output.
This seems relatively unlikely to cause any problems in practice,
as the worst case only occurs if the input string contains no
characters other than single-quote or newline, and even then
malloc alignment padding would probably save the day.  But it's
definitely a bug.

David Rowley

Files

PathChange+/−
src/bin/psql/command.c modified +1 −1