Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEi16-0036cS-NG for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jun 2024 04:12:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sEi16-004tI3-Oh for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jun 2024 04:12:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEi16-004tHv-F8 for pgsql-hackers@lists.postgresql.org; Wed, 05 Jun 2024 04:12:52 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sEi11-0003jt-28 for pgsql-hackers@postgresql.org; Wed, 05 Jun 2024 04:12:51 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1f612d7b0f5so3538935ad.0 for ; Tue, 04 Jun 2024 21:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717560765; x=1718165565; darn=postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=QTmsk+C9d/2V8tBTmA7xKJC14HOd/NXRofzqaMclJJA=; b=Sooad4c5Gz6ZuOwY4VEKlBbLbfgmmO9Tuc0xzxBjPbWVEAlYTtCR7rMrZAVfRvKogp FIiU40Y1x/AxWG1fWE0njrXsKIKi33ZCbo1ivcSbL0UfqP7iez7Lcl2IJobGq2A4BXIE fJkGfaHTTtDy9s0g9SldNSNJPiSrda/pPE0ejMwG5SAA68yaXrCYXFO50r4f7KuvsJsy ezcmRVTnv36r/cLfp1ZHNa6YW2Yb8U2tN3LBSeyvcdctTelnw5CffGm8Yh225pGxRogU RKLiuJ3xKItV2J02XtBWJlEPrjGQtEn9wyiPLG7m5MvJT+gVvXEJYdaAMBD2URBvMK6D 5azw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717560765; x=1718165565; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QTmsk+C9d/2V8tBTmA7xKJC14HOd/NXRofzqaMclJJA=; b=WRh9lIUx/Hp1hsK/iR+i4ER+cc5pMhJuZFSdkUXILbBpPMjL+dpSW1VP6A+DN4WwVT 3oBw9kNRs7HW4WM/5cAqsMOVo1kHwc02AE6IbhkzkySbZziHrC2J2lmSPl2awwhV1Cnm WqwWumuO42/oQvW1G4Bf1gPrj7bxopYk61zuSzvERFU/5CpXCw2WMBAel7zX5t9httbd J+IURV6OKeV8FE1ABcsF/L4AzkmqzTtIC/DLBWMMKFT+J29MemquFY5McylK2K0akFAe +TDlnMGdYUlVnkEM6n89PLG8Q3Dn+c1mwPg1TSVfK1V71uuzzr0QB0NM17PpjxrqYoIG aLKA== X-Gm-Message-State: AOJu0YxRPYtVURFaMqRTCWHCVRxi7yyXdr9Wiz+5nUyGhHEDuMOyUTyn VWMf88jV91Rxil/gTspClpdBCVHzsZhIqjOwUp9vkz7I8We5cgjB X-Google-Smtp-Source: AGHT+IHl26JFpQgyE54EA5CcheTjOjjZktW6egVTqWig9BramnyFNbuBFKLwkSNtP9j+nBo5cRHz2A== X-Received: by 2002:a17:902:dac8:b0:1eb:7162:82c7 with SMTP id d9443c01a7336-1f6a569e4eemr22799575ad.18.1717560764611; Tue, 04 Jun 2024 21:12:44 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323feca1sm93879445ad.231.2024.06.04.21.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 21:12:44 -0700 (PDT) Date: Wed, 05 Jun 2024 13:12:41 +0900 (JST) Message-Id: <20240605.131241.1337361574087593814.horikyota.ntt@gmail.com> To: ranier.vf@gmail.com Cc: pgsql-hackers@postgresql.org Subject: Re: Fix use of possible uninitialized variable retval (src/pl/plpgsql/src/pl_handler.c) From: Kyotaro Horiguchi In-Reply-To: References: User-Agent: Mew version 6.8 on Emacs 27.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Mon, 27 May 2024 11:31:24 -0300, Ranier Vilela wrote in > Hi. > > The function *plpgsql_inline_handler* can use uninitialized > variable retval, if PG_TRY fails. > Fix like function*plpgsql_call_handler* wich declare retval as > volatile and initialize to (Datum 0). If PG_TRY fails, retval is not actually accessed, so no real issue exists. Commit 7292fd8f1c changed plpgsql_call_handler() to the current form, but as stated in its commit message, it did not fix a real issue and was solely to silence compiler. I believe we do not need to modify plpgsql_inline_handler() unless compiler actually issues a false warning for it. regards. -- Kyotaro Horiguchi NTT Open Source Software Center