postgresql-10.0/src/backend/access/transam/clog.c:234: sanity check after use ?

Started by David Bindermanover 8 years ago2 messagesbugs
Jump to latest
#1David Binderman
dcb314@hotmail.com

Hello there,

postgresql-10.0/src/backend/access/transam/clog.c:234]: (style) Array index 'i' is used before limits check.

Source code is

while (TransactionIdToPage(subxids[i]) == pageno && i < nsubxids)

Maybe it is better to sanity check the array index before use, not after.

Regards

David Binderman

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Binderman (#1)
Re: postgresql-10.0/src/backend/access/transam/clog.c:234: sanity check after use ?

David Binderman <dcb314@hotmail.com> writes:

postgresql-10.0/src/backend/access/transam/clog.c:234]: (style) Array index 'i' is used before limits check.

Yeah, this is pretty bogus, will fix (and the same for your other one).

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs