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

From: David Binderman <dcb314(at)hotmail(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: postgresql-10.0/src/backend/access/transam/clog.c:234: sanity check after use ?
Date: 2017-10-06 15:15:46
Message-ID: HE1PR0802MB2331CBA919CBFFF0C465EB429C710@HE1PR0802MB2331.eurprd08.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Binderman 2017-10-06 15:18:07 postgresql-10.0/src/backend/optimizer/geqo/geqo_ox2.c:84:sanity check after use ?
Previous Message David Binderman 2017-10-06 15:10:29 Re: postgresql-10.0/src/bin/psql/mainloop.c:465: suspicious condition ?