Seg-fault in format(text)

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Seg-fault in format(text)
Date: 2011-05-23 14:02:51
Message-ID: BANLkTikCHX07tiKBnHM4EM2FE=Cw+sznHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Testing 9.1beta:

select format('Hello %s, %2147483648$s', 'World');
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

The problem is that the test for overflow of the arg position doesn't
catch all cases. The simplest solution is to just tweak the comparison
at varlena.c:3840 (patch attached) although maybe there are neater
ways...

Regards,
Dean

Attachment Content-Type Size
format.patch text/x-patch 617 bytes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-05-23 14:33:11 Re: Seg-fault in format(text)
Previous Message Bruce Momjian 2011-05-23 12:26:27 Re: [BUGS] BUG #6034: pg_upgrade fails when it should not.