Re: [PATCH] avoid buffer underflow in errfinish()

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Xi Wang <xi(dot)wang(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] avoid buffer underflow in errfinish()
Date: 2013-12-02 15:44:14
Message-ID: CA+TgmobT2q-wG+nzEqwBp+=3zpqrPia9pwi+e50xJBU6=LCdxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 30, 2013 at 2:00 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> On Wed, Mar 27, 2013 at 08:45:51AM -0400, Robert Haas wrote:
>> On Sat, Mar 23, 2013 at 6:38 PM, Xi Wang <xi(dot)wang(at)gmail(dot)com> wrote:
>> > CHECK_STACK_DEPTH checks if errordata_stack_depth is negative.
>> > Move the dereference of &errordata[errordata_stack_depth] after
>> > the check to avoid out-of-bounds read.
>>
>> This seems sensible and I'm inclined to commit it. It's unlikely to
>> matter very much in practice, since the only point of checking the
>> stack depth in the first place is to catch a seemingly-unlikely coding
>> error; and it's unlikely that referencing beyond the stack bounds
>> would do anything too horrible, either. But we may as well do it
>> right.
>
> Was this ever dealt with?

No, it fell through the cracks. I have just committed it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-12-02 15:44:19 Re: Extension Templates S03E11
Previous Message Stephen Frost 2013-12-02 15:37:25 Re: Extension Templates S03E11