Re: [BUG FIX] Uninitialized var fargtypes used.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG FIX] Uninitialized var fargtypes used.
Date: 2019-11-11 17:32:38
Message-ID: 6021.1573493558@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ranier Vilela <ranier_gyn(at)hotmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-11-11 18:01:35 BUG #16106: Patch - Radius secrets always gets lowercased
Previous Message Ranier Vilela 2019-11-11 17:03:33 [BUG FIX] Uninitialized var fargtypes used.