Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUDYT-0006Wd-5P for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Nov 2019 17:32:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iUDYR-0000wT-SY for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Nov 2019 17:32:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUDYR-0000wL-L2 for pgsql-bugs@lists.postgresql.org; Mon, 11 Nov 2019 17:32:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUDYP-0007Xc-JT for pgsql-bugs@lists.postgresql.org; Mon, 11 Nov 2019 17:32:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xABHWcAn006022; Mon, 11 Nov 2019 12:32:38 -0500 From: Tom Lane To: Ranier Vilela cc: PostgreSQL mailing lists Subject: Re: [BUG FIX] Uninitialized var fargtypes used. In-reply-to: References: Comments: In-reply-to Ranier Vilela message dated "Mon, 11 Nov 2019 17:03:33 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6020.1573493558.1@sss.pgh.pa.us> Date: Mon, 11 Nov 2019 12:32:38 -0500 Message-ID: <6021.1573493558@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ranier Vilela 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