Re: [BUG FIX] Uninitialized var fargtypes used. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUG FIX] Uninitialized var fargtypes used.
Date
Msg-id 6021.1573493558@sss.pgh.pa.us
Whole thread Raw
In response to [BUG FIX] Uninitialized var fargtypes used.  (Ranier Vilela <ranier_gyn@hotmail.com>)
Responses Re: [BUG FIX] Uninitialized var fargtypes used.
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Ranier Vilela
Date:
Subject: [BUG FIX] Uninitialized var fargtypes used.
Next
From: PG Bug reporting form
Date:
Subject: BUG #16106: Patch - Radius secrets always gets lowercased