Re: postgres 9.0 beta libpq empty binary array error

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: vshahov(at)alliedtesting(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org, pgagarinov(at)alliedtesting(dot)com, depstein(at)alliedtesting(dot)com
Subject: Re: postgres 9.0 beta libpq empty binary array error
Date: 2010-08-11 19:13:54
Message-ID: 4C62F672.1010009@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 09/08/10 21:29, Heikki Linnakangas wrote:
> On 09/08/10 21:26, Tom Lane wrote:
>> Heikki Linnakangas<heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>>> The behavior of empty arrays with dimensions is weird in general.
>>
>> Agreed, but we shouldn't be introducing random restrictions in the name
>> of security.
>>
>> Patch looks good to me, except that it occurs to me to wonder about
>> negative values of dim[i]. For small negative values this coding
>> will catch it, but what if it's large enough to overflow the other way?
>> Maybe use
>>
>> if (dim[i]< 0 || lBound[i]> ub)
>> ereport...
>
> ArrayGetNItems checks for dim[i] < 0. I concur though that it looks
> weird to not check that along with the overflow check, so maybe we
> should, just to make the code clearer.

Committed. I added a comment noting that dim[i] < 0 is checked in
ArrayGetNItems.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Lucian Capdefier 2010-08-11 19:39:01 Lucian Capdefier wants to stay in touch on LinkedIn
Previous Message Kevin Grittner 2010-08-11 18:42:12 Re: BUG #5607: memmory leak in ecpg