Re: [CHECKER] 9 potential out-of-bounds array access errors - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [CHECKER] 9 potential out-of-bounds array access errors
Date
Msg-id 12211.1043798734@sss.pgh.pa.us
Whole thread Raw
In response to [CHECKER] 9 potential out-of-bounds array access errors  ("Yichen Xie" <yxie@cs.stanford.edu>)
Responses Re: [CHECKER] 9 potential out-of-bounds array access errors  (Yichen Xie <yxie@cs.stanford.edu>)
List pgsql-bugs
Yichen Xie <yxie@cs.stanford.edu> writes:
> Both are flagged though--the other one's 85 lines down in the bug report..
> ;) I probably should've sorted the list by location to minimize confusion.

That's okay, I probably should've read the whole mail before commenting ;-)


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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [CHECKER] 9 potential out-of-bounds array access errors
Next
From: Tatsuo Ishii
Date:
Subject: Re: [CHECKER] 9 potential out-of-bounds array access errors