From: Peter Eisentraut <peter_e@gmx.net>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: Re: pgsql: Support opfamily members in get_object_address
Date: Mon, 16 Mar 2015 16:41:15 -0400
Message-ID: <55073FEB.6040404@gmx.net> (raw)
In-Reply-To: <E1YXWbp-0006cW-W3@gemulon.postgresql.org>
References: <E1YXWbp-0006cW-W3@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 3/16/15 11:07 AM, Alvaro Herrera wrote:
> Support opfamily members in get_object_address
I get compiler warnings from this:
objectaddress.c: In function ‘get_object_address’:
objectaddress.c:1428:12: warning: array subscript is above array bounds
[-Warray-bounds]
objectaddress.c:1430:11: warning: array subscript is above array bounds
[-Warray-bounds]
This looks fishy:
1423 i = 0;
1424 foreach (cell, objargs)
1425 {
1426 ObjectAddress typaddr;
1427
1428 typenames[i] = strVal(lfirst(cell));
1429 typaddr = get_object_address_type(OBJECT_TYPE, cell, missing_ok);
1430 typeoids[i] = typaddr.objectId;
1431 if (i++ >= 2)
1432 break;
1433 }
Since you're using a postfix increment, the loop will execute with i =
2, which will lead to the array bounds violation.
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter_e@gmx.net, alvherre@alvh.no-ip.org
Subject: Re: pgsql: Support opfamily members in get_object_address
In-Reply-To: <55073FEB.6040404@gmx.net>
References: <E1YXWbp-0006cW-W3@gemulon.postgresql.org> <55073FEB.6040404@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox