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

From Kyotaro Horiguchi
Subject Re: [BUG FIX] Uninitialized var fargtypes used.
Date
Msg-id 20191112.152735.1553219354453261228.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: [BUG FIX] Uninitialized var fargtypes used.  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [BUG FIX] Uninitialized var fargtypes used.
List pgsql-hackers
At Tue, 12 Nov 2019 12:31:41 +0900, Michael Paquier <michael@paquier.xyz> wrote in 
> On Mon, Nov 11, 2019 at 06:28:47PM +0000, Ranier Vilela wrote:
> > Can anyone check this bug fix?
> > 
> > +++ event_trigger.c     Mon Nov 11 13:52:35 2019
> > @@ -171,7 +171,7 @@
> >          HeapTuple       tuple;
> >          Oid                     funcoid;
> >          Oid                     funcrettype;
> > -       Oid                     fargtypes[1];   /* dummy */
> > +       Oid                     fargtypes[1] = {InvalidOid, InvalidOid};        /* dummy */
> >          Oid                     evtowner = GetUserId();
> 
> Yeah, it would be better to fix this initialization.

Agreed, but compiler should complain since the initializer is too
long. And I found at least five other instances of the same. Or there
might be similar cases.


find . -type f -exec egrep --color -nH --null -e 'LookupFuncName ?\(.*, ?0,' \{\} +
./pl/tcl/pltcl.c�619:    procOid = LookupFuncName(namelist, 0, fargtypes, false);
./backend/commands/trigger.c�693:        funcoid = LookupFuncName(stmt->funcname, 0, fargtypes, false);
./backend/commands/proclang.c�108:        handlerOid = LookupFuncName(funcname, 0, funcargtypes, true);
./backend/commands/proclang.c�266:        handlerOid = LookupFuncName(stmt->plhandler, 0, funcargtypes, false);
./backend/commands/event_trigger.c�240:    funcoid = LookupFuncName(stmt->funcname, 0, fargtypes, false);
./backend/commands/foreigncmds.c�484:    handlerOid = LookupFuncName((List *) handler->arg, 0, funcargtypes, false);

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Guram Duka
Date:
Subject: Re: [PATCH] Fix PostgreSQL server build and install problems under MSYS2
Next
From: Yonatan Misgan
Date:
Subject: Extension development