[BUGS] postgresql-10.0/src/backend/access/transam/clog.c:234: sanity checkafter use ? - Mailing list pgsql-bugs

From David Binderman
Subject [BUGS] postgresql-10.0/src/backend/access/transam/clog.c:234: sanity checkafter use ?
Date
Msg-id HE1PR0802MB2331CBA919CBFFF0C465EB429C710@HE1PR0802MB2331.eurprd08.prod.outlook.com
Whole thread Raw
Responses Re: [BUGS] postgresql-10.0/src/backend/access/transam/clog.c:234: sanity check after use ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: David Binderman
Date:
Subject: Re: [BUGS] postgresql-10.0/src/bin/psql/mainloop.c:465: suspiciouscondition ?
Next
From: David Binderman
Date:
Subject: [BUGS] postgresql-10.0/src/backend/optimizer/geqo/geqo_ox2.c:84:sanity checkafter use ?