Re: Buffer overflow in psql - Mailing list pgsql-general

From Tom Lane
Subject Re: Buffer overflow in psql
Date
Msg-id 2950.1164221571@sss.pgh.pa.us
Whole thread Raw
In response to Re: Buffer overflow in psql  (Jack Orenstein <jorenstein@archivas.com>)
Responses Re: Buffer overflow in psql  ("John D. Burger" <john@mitre.org>)
List pgsql-general
Jack Orenstein <jorenstein@Archivas.com> writes:
> Tom Lane wrote:
>> Good catch!  What platform and compiler are you using exactly?  I'd
>> imagine that on most platforms, the size of that array is effectively
>> rounded up to 12 bytes due to alignment/padding considerations, which
>> would mask the mistake.  Yours must somehow be putting something
>> critical right after the array.

> We're using gcc-4.0.2-8.fc4 on FC4 (intel). I believe that we didn't
> just get lucky with the overflow. One of our Linux experts says that
> our libc is doing memory bounds checking.

Ah so, that explains how come it noticed.  BTW, I see that somebody
already changed the array size to 16 bytes in HEAD --- so it's just
the back branches that need fixing.

            regards, tom lane

pgsql-general by date:

Previous
From: Wim Bertels
Date:
Subject: Grant group revoke user isue
Next
From: "Brandon Aiken"
Date:
Subject: Re: MSSQL to PostgreSQL : Encoding problem