Re: BUG #8702: psql \df+ translate_columns[] overflow and unexpected gettext translation

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: eshkinkot(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8702: psql \df+ translate_columns[] overflow and unexpected gettext translation
Date: 2013-12-28 03:50:37
Message-ID: 1388202637.18242.3.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 2013-12-27 at 00:00 +0000, eshkinkot(at)gmail(dot)com wrote:
> I get this result from \df+ foo:
> --- echo $LANG
> --- ru_RU.UTF-8
> ---
> --- create function foo() returns void language plpgsql as $$ begin end $$;

> src/bin/psql/describe.c:describeFunctions translate_columns[] array size
> is less than the maximum number of columns in query and it overflowed in
> src/bin/psql/print.c:printQuery at
> ...
> translate = (opt->translate_columns &&
> opt->translate_columns[c]);
> ...
> so in my case opt->translate_columns[10] have garbage == true and
> "Description" field
> content translated unexpectedly.

There are several places that are similarly broken. See attached patch.

Obviously, this is not a very robust programming interface, if the same
mistake has been repeated three times independently.

Attachment Content-Type Size
0001-psql-Fix-translate_columns-counts.patch text/x-patch 1.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-12-29 00:28:52 Re: to_number nl_NL.utf8
Previous Message Andrew Dunstan 2013-12-27 22:23:38 Re: BUG #8676: Bug Money JSON