Re: [CHECKER] 9 potential out-of-bounds array access errors

From: Yichen Xie <yxie(at)cs(dot)stanford(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, <mc(at)cs(dot)stanford(dot)edu>
Subject: Re: [CHECKER] 9 potential out-of-bounds array access errors
Date: 2003-01-29 00:30:07
Message-ID: Pine.LNX.4.44.0301281621260.3200-100000@canoe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I think it's 'coz the only assignment to "plpgsql_nDatums" the checker
could find is on line 176, without realizing plpgsql_nDatums is actually a
global variable and could be changed anywhere... We'll rule out cases like
this in the future. Thanks for letting us know. --yichen

On Tue, 28 Jan 2003, Tom Lane wrote:

> I'm confused by the entry flagging pl_comp.c:527:
>
> [BUG] is plpgsql_nDatums 0 here? also, sizeof (plpgsql_nDatums) =
> 2*sizeof(PLpgSQL_datum *)
>
> Is the thing concerned because malloc(0) may yield NULL on some
> platforms? If so, should I object that it ought to be smart enough to
> know the loop won't execute in that case? Or am I missing something?
> Also, I don't understand your comment about the sizeof() relationship.
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2003-01-29 01:07:30 Re: [CHECKER] 9 potential out-of-bounds array access errors
Previous Message Tom Lane 2003-01-29 00:05:34 Re: [CHECKER] 9 potential out-of-bounds array access errors