pgsql: Fix out-of-array-bounds compiler warning

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix out-of-array-bounds compiler warning
Date: 2015-03-17 01:55:50
Message-ID: E1YXgjW-0008Gt-KT@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix out-of-array-bounds compiler warning

Since the array length check is using a post-increment operator, the
compiler complains that there's a potential write to one element beyond
the end of the array. This is not possible currently: the only path to
this function is through pg_get_object_address(), which already verifies
that the input array is no more than two elements in length. Still, a
bug is a bug.

No idea why my compiler doesn't complain about this ...

Pointed out by Dead Rasheed and Peter Eisentraut

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a190738457353ddb60743e45972f6fe50a75ee77

Modified Files
--------------
src/backend/catalog/objectaddress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2015-03-17 03:01:28 Re: [HACKERS] get_object_address support for additional object types
Previous Message Peter Eisentraut 2015-03-16 20:41:15 Re: pgsql: Support opfamily members in get_object_address