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 1iUwzI-0008ES-6m for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Nov 2019 18:03:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iUwzH-0005cC-0U for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Nov 2019 18:03:27 +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 1iUwzG-0005bd-Nl for pgsql-bugs@lists.postgresql.org; Wed, 13 Nov 2019 18:03:26 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUwzE-0008Cz-FX for pgsql-bugs@lists.postgresql.org; Wed, 13 Nov 2019 18:03:26 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3DF80637; Wed, 13 Nov 2019 13:03:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 13 Nov 2019 13:03:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=7tiqwF+eUuOxO0+7bc2EZZS6nu8 VQDGd11zbBsKvvZo=; b=JfZzRFhe/JSyMjYK+FBGDEYvUTFRdcxSwcDbZpWjzce c/fA0BRwoWZMtA7sAFO5yQhbbCIliSOydxk9hoSKdFDUXnmmXd3RzYwM7wTDCyyr B0QrsjoOXwqsRwOyoqyUc+G9NLH6ZaDp7sR9J/hejEbVjsurWBRXcbSvCvsFX6hh EbldkgvSlb3J3TKQTPcpimd7SEFOzhrmI7Kqf5YWdXoNzRrROHNoHuesoBUdCZ68 PHyBmxE5DiIfVeHFj3KVxGJzi3nHPsoRUOGJ0tqc6KF0b6xUL294foHJuM+AOPMD A0hKQGg7pxrVyv001tThfUcTGbtB4ZWmCtwQtD9RE7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7tiqwF +eUuOxO0+7bc2EZZS6nu8VQDGd11zbBsKvvZo=; b=TNUk4dTF/8/Yh2FkBQUJPN mJDCbzEkA55xn/3Ofkf9orU1TiR9UgNxKPxMLVzJWafyxR3J3VoiKqnwLY41WaTb ljl2bZp5EQybDQyuTy8qB0YuYNh8ZInnfqNax8a5nvY9uyvEN6+wBe9/kI98Rv07 L7sEkybno3gRT6QBJdUELBPwevMWfVqzlIrNznAh6SVwkTpN3jULHXXh0kLr92t2 sZ35mhWCsNTRUbsbpZ0q5O871zuAGTf94zNwrFTerdlR00vITJuc4Vv8eEypt9gt WiyLqlWxHSk/u3DeeNwH4NoX0lO413zo8oitlCMJNDeAuBX8Vqe07+ZHK3KvBp9g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudefuddgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegr nhgrrhgriigvlhdruggvqeenucfkphepieejrdduiedtrddvudekrddvfeejnecurfgrrh grmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvgenucevlhhu shhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-218-237.hsd1.ca.comcast.net [67.160.218.237]) by mail.messagingengine.com (Postfix) with ESMTPA id 6F12280059; Wed, 13 Nov 2019 13:03:21 -0500 (EST) Date: Wed, 13 Nov 2019 10:03:20 -0800 From: Andres Freund To: Ranier Vilela Cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: [BUG] Uninitializaed configOut.leafType used. Message-ID: <20191113180320.gl27ldjjgex2x6ad@alap3.anarazel.de> References: <32631.1573665493@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-11-13 17:55:40 +0000, Ranier Vilela wrote: > Ok, so all these commands are for what? "commands"? > case SPGIST_CONFIG_PROC: > ok = check_amproc_signature(procform->amproc, VOIDOID, true, > 2, 2, INTERNALOID, INTERNALOID); > configIn.attType = procform->amproclefttype; > memset(&configOut, 0, sizeof(configOut)); > > OidFunctionCall2(procform->amproc, > PointerGetDatum(&configIn), > PointerGetDatum(&configOut)); > > configOutLefttype = procform->amproclefttype; > configOutRighttype = procform->amprocrighttype; > > /* > * When leaf and attribute types are the same, compress > * function is not required and we set corresponding bit in > * functionset for later group consistency check. > */ > if (!OidIsValid(configOut.leafType) || > configOut.leafType == configIn.attType) > { > > When case SPGIST_CONFIG_PROC, OidIsValid(configOut.leafType) is tested, > but when case SPGIST_COMPRESS_PROC is fired, OidIsValid(configOut.leafType) is not necessary and configOut.leafType > happy accessed? Even if that were a problem - and I don't see why - that'd still not make configOut.leafType be uninitialized. The SPGIST_CONFIG_PROC case is always hit before SPGIST_COMPRESS_PROC, therefore configOut is always initialized (c.f. memset(0) and the call to amproc to initialize the contents). And the OidIsValid() call is about whether a leafType is set or not, the call to check_amproc_signature() doesn't need that. - Andres