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 1rbuCm-00HWFK-C8 for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Feb 2024 03:20:33 +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 1rbuCk-00CAPG-48 for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Feb 2024 03:20:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbuCi-00CAP8-FF for pgsql-hackers@lists.postgresql.org; Mon, 19 Feb 2024 03:20:29 +0000 Received: from fout6-smtp.messagingengine.com ([103.168.172.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbuCf-007SMa-AI for pgsql-hackers@postgresql.org; Mon, 19 Feb 2024 03:20:27 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id BB5B013800BC; Sun, 18 Feb 2024 22:20:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 18 Feb 2024 22:20:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1708312823; x=1708399223; bh=yJg1REJt3w opuRR3N0ugT7AZOMRl8dH3/CBgI47uNVk=; b=OVqAUsT6xkiJ6ymOUHT9CjbyLy ebq60WcKBdtoeMDUK07aWbrPFtzKHsBYNH99j3fsV1f1MiTa8I/iGmu0NCrihooG zZcJYjCTaqgu/VKC19fDxVyfKK4+jG3BTtz+4bDs41/bZeMQvEsrQiNfQq2NUVPA YMXK3Oj+f4xIgq9/IDK3ChSX84qnT1hVANMtQHV+KcuvhID7Kv2kqNXhtKPMqEy5 5upbiL71A3LBlQEk6VSjsHRXxq49ORZwtPCHhn29iZ8Ms0TBpt/3AO3KyHsFJpfR mfRfOvp5bt/cRlT4GNtL7u9+51hgasN3y++lLwm7mda9K6f9WgpH3m+kxdQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1708312823; x=1708399223; bh=yJg1REJt3wopuRR3N0ugT7AZOMRl 8dH3/CBgI47uNVk=; b=NlATDJzJy9ze1Wi1iuObLW2n+0A3prq/xpPSE5UzZBkj 1gmUpxQA6zIAxQWpG6KW5YmceJsLsSiHkvuQmfhLxI75UPFhx8ybNs1j/WauYug9 fjHGzQFwnGjKYTmgRVYYUC1PmwPaLHNud4XClYCziaILaF/0VBz93td20pXlf1xl I8cjWK8mEBdk5jQt0fVlLJF/wIi339Z3KtZFKmODwuUIKSrc3zGCs3iTxgssS6io fNJM1V/5eEa5E2lVI1HSdK7WJUGaF+BHesWkMn8JOKBZHlcJ0QhOPf0E0LZmMFDQ Me/av/Ec9bkfcdWrJP7+zRtVTgUXwA7vf4nHsV/eiQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Feb 2024 22:20:21 -0500 (EST) Date: Mon, 19 Feb 2024 12:20:12 +0900 From: Michael Paquier To: Oleg Tselebrovskiy Cc: Ashutosh Bapat , pgsql-hackers@postgresql.org Subject: Re: Returning non-terminated string in ECPG Informix-compatible function Message-ID: References: <4ab77531d15e9234ea4615dd8501078d@postgrespro.ru> <9e6bd5d519c312ffdfa9a3c39b95910f@postgrespro.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+Jg5F0FXVu6HYblV" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --+Jg5F0FXVu6HYblV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 15, 2024 at 05:17:17PM +0700, Oleg Tselebrovskiy wrote: > Thanks for review! dt_common.c is quite amazing, the APIs that we have in it rely on strcpy() but we have no idea of the length of the buffer string given in input to store the result. This would require breaking the existing APIs or inventing new ones to be able to plug some safer strlcpy() calls. Not sure if it's really worth bothering. For now, I've applied the OOM checks on HEAD and the fix with the null termination on all stable branches. -- Michael --+Jg5F0FXVu6HYblV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmXSyOwACgkQnvQgOdby QH2/oxAAnAL/szsrdUEl9M+f/uovF8M/7fEoHOdz89QvKdkLl7wjqlOlGvM4aYCc 4Rb9uksN5799uJMHYRpVVqscCNSRciT/YXIGZidf4UxDbPFFhrduUS4yLh3QL9jd 0daNsNHkrwqczDvRC2BPS9ASJSBPnDgXQ6oub6INGXiYj223AQTZ0uiTPVhokj1I 63FLD7WrAZE9ANnHiC3QCtHBy2Y/mwdHfmDH08Wx19duOp9By/V6GwfCs1jTufAd plN7IKyl207QVzjvDjE7sWx8nsKVHciXoQnRueCcXThStGB5ugUUo2jvWOX1JJmF w0o53LKBMhoLsJFWT+fZTr9JPVfXU32iezr6QHXRjwqc1CGDYIZBM9zVmJG/AMa6 qjBtsoyR8OCECyZ3DGdjImtW2vobEOb4gjNa4VSdOL5w1oten3TYkRbJKCG4bxiU L+b6n1M4ZPQt/41s+yIyZ+aKPWdTwlBaf7n0wxmcDzIsV0d7CLK4DF2BnZDB+Jb+ qXs5+2durgxBsBvriMfW5pxZqAZkh1kOLpG4MVqLxPQl+8QTIjUq6OzNUBTrQJpe hrQNY5LnUmUzfbbwE1P+0TXOEUBtSe+zLVSRGuC0gi9vvEvyULEUtkezCprtzV4p oD6PJq/rHbQ+E1OhFbDOMhG9UusBVkPlAsC+4kTc9qyF7FdseZM= =I8QK -----END PGP SIGNATURE----- --+Jg5F0FXVu6HYblV--