pset_quoted_string is broken

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pset_quoted_string is broken
Date: 2014-10-26 22:40:24
Message-ID: CAApHDvrvbkpn6BVWCnDEfE2v+kgRmNgcpmL3rF7d-+-PnwMTcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
pset_quoted_string_fix.diff text/plain 389 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-10-26 22:52:12 Re: narwhal and PGDLLIMPORT
Previous Message Noah Misch 2014-10-26 22:22:01 Re: narwhal and PGDLLIMPORT