pset_quoted_string is broken - Mailing list pgsql-hackers

From David Rowley
Subject pset_quoted_string is broken
Date
Msg-id CAApHDvrvbkpn6BVWCnDEfE2v+kgRmNgcpmL3rF7d-+-PnwMTcg@mail.gmail.com
Whole thread Raw
Responses Re: pset_quoted_string is broken
List pgsql-hackers
It seems the buffer created in pset_quoted_string is just 1 char too small.

This breaks psql's \pset for me, though I've no idea why the buildfarm is not complaining a bit more.

As it stands, if the function is given an empty string to quote, it tries to build a string with 2 single quotes and a NUL. This needs 3 chars, not 2.

The attached simple patch fixes the problem.
Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: narwhal and PGDLLIMPORT
Next
From: Tom Lane
Date:
Subject: Re: narwhal and PGDLLIMPORT