Re: postgres 9.0 beta libpq empty binary array error

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: vshahov(at)alliedtesting(dot)com, 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-09 18:29:10
Message-ID: 4C6048F6.70505@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rob Brucks 2010-08-09 19:13:30 BUG #5609: Exclusive Locks & Permission
Previous Message Tom Lane 2010-08-09 18:26:22 Re: postgres 9.0 beta libpq empty binary array error