From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ranier Vilela <ranier_gyn@hotmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: [BUG FIX] Uninitialized var fargtypes used.
Date: Mon, 11 Nov 2019 12:32:38 -0500
Message-ID: <6021.1573493558@sss.pgh.pa.us> (raw)
In-Reply-To: <MN2PR18MB2927F24692485D754794F01BE3740@MN2PR18MB2927.namprd18.prod.outlook.com>
References: <MN2PR18MB2927F24692485D754794F01BE3740@MN2PR18MB2927.namprd18.prod.outlook.com>
Ranier Vilela <ranier_gyn@hotmail.com> writes:
> Can anyone check this bug fix?
> - Oid fargtypes[1]; /* dummy */
> + Oid fargtypes[1] = {InvalidOid, InvalidOid}; /* dummy */
Well, it's wrong on its face, because that array only has one element
not two. But why do you care? The element will never be accessed.
The only reason we declare this variable at all is that LookupFuncName
requires a non-null pointer, which if memory serves is because memcmp()
with a null pointer is formally undefined even if the count is zero,
cf commit 0a52d378b.
Maybe it would've been better to make LookupFuncName deal with the
case instead of requiring callers to do strange things. But I don't
see any bug here.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, ranier_gyn@hotmail.com
Subject: Re: [BUG FIX] Uninitialized var fargtypes used.
In-Reply-To: <6021.1573493558@sss.pgh.pa.us>
References: <MN2PR18MB2927F24692485D754794F01BE3740@MN2PR18MB2927.namprd18.prod.outlook.com> <6021.1573493558@sss.pgh.pa.us>
* 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