Re: postgres 9.0 beta libpq empty binary array error - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: postgres 9.0 beta libpq empty binary array error
Date
Msg-id 4C6048F6.70505@enterprisedb.com
Whole thread Raw
In response to Re: postgres 9.0 beta libpq empty binary array error  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: postgres 9.0 beta libpq empty binary array error
List pgsql-bugs
On 09/08/10 21:26, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgres 9.0 beta libpq empty binary array error
Next
From: "Rob Brucks"
Date:
Subject: BUG #5609: Exclusive Locks & Permission