Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVmsQ-00041C-PN for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Apr 2021 03:04:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lVmsO-0006bh-L9 for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Apr 2021 03:04:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVmsN-0006ba-BG for pgsql-bugs@lists.postgresql.org; Mon, 12 Apr 2021 03:04:36 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVmsJ-0000hs-Rp for pgsql-bugs@lists.postgresql.org; Mon, 12 Apr 2021 03:04:34 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5FED75C0054; Sun, 11 Apr 2021 23:04:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 11 Apr 2021 23:04:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=mr3KejnuxSdTrQH/qYptcZ23EFL A8U9RKqQaab/v+iw=; b=Jb0FTVw4LuvvjIHdd8OxO0yEnPF4r79S+QSgs3TCTgm EfLmcGM6i/+Gqglfh1MeBGfYt0odenJJGy0sd+pxcxwnsqzM4BoEh8zAJ1Fgm28h hzI9NP4CXZfazrvodCYvsXcop8gg2PjFafpCuobnGKZopgvFukuQlX5aYCvD27zJ a45iHBzeKa8dc6N8FJ9jMV2yxAatADvj3i7M+8olRhjSpyeidMWR78NbR1bHM8TM spWIsm1FvlUs+gEVaC5ByVay7bHkVsOGtk2oc+TojBGLpnYFcpOiIR5kJj89SSkn Jfb7GuTEaCil4xAaiZVtWYv8tD4x0XwKwxOHLWrpTcQ== 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=fm2; bh=mr3Kej nuxSdTrQH/qYptcZ23EFLA8U9RKqQaab/v+iw=; b=au/uOtC7uttdaecgsi0RRz 0yoGjkvFsU4TxiW33iq5Wgb6HnPjD2YeCWksZmEDTdKpx2LbFz5/aSrkzVxA0neb cKlNNgZV+5yWZJ+0ACZZnpUnWpdpR9yoy6HsMAV1Radj+AFzv8+DryJkQm7ttm60 MYOEQjsXxmU8+rSzmpd47XcasPFx6BRGwXLxlc4eT4VGP7KtfyB/w3p9HvAnGnLK IMryCwIxUJu3t49nEZXe8ME6zEZbjIMxpiwBaYYEH0nqevGEWGxT47KCsCWNWl0s HTN9GiEpsqv/gfk/Ryj4XV3SvPy78xnh6Nm+ifS+lodW0lfEVuh/VyFEkarzDD9A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekiedgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpedvgeduuefhtdeuleettdevjeehheeiveeuieegleetgeeljeelieeuieehgeevhfen ucfkphepudduuddruddtvddrudektddrudekheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id D2919240054; Sun, 11 Apr 2021 23:04:26 -0400 (EDT) Date: Mon, 12 Apr 2021 12:04:23 +0900 From: Michael Paquier To: Julien Rouhaud Cc: t.larionov@postgrespro.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16953: OOB access while converting "interval" to char Message-ID: References: <16953-f255a18f8c51f1d5@postgresql.org> <20210407120856.3rjxxnnzzxn74vyv@nol> <20210408110403.wr3d552xilqsx4us@nol> <20210409104246.vkeef6rbyevq46f3@nol> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZTtmoRa3RpyP27k4" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ZTtmoRa3RpyP27k4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 09, 2021 at 07:58:51PM +0900, Michael Paquier wrote: > Yep. The regression tests show what I would expect. I'll check in > details later. I have spent some time on that today and applied this patch down to 9.6, after adding more comments and simplifying a bit the calculation method used. Instead of using the "mon" variable to store an intermediate result, I have simplified things so as this only uses tm->tm_mon, and "mon" for the position in the roman-numeral array is adjusted only once. -- Michael --ZTtmoRa3RpyP27k4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmBzuLcACgkQnvQgOdby QH3GJg/+PAqN6tn3Avg9PJJVyTlqIKRHO/qMkbdLhzQPkXV6MTWyytcnu8QXgvay EaBiRoO4jqqwblw38meqYGX8swAdgDI580SsQ1AeL3vQt7cgJG2/YbYqp9zUvdWm pqFlvwCjExxhTSzaOdQYmn3TKqujEZUCxZQbU1dzHaND4/jMRkp3rFK4a9t2UVuE nMXkz0K/X0neHhNmegOC147oqpqMmduyB1iEiG8AchSdpf4bX91YheZcUExuYvpE TnIoiKPNqG7JIN2GoUvTZvvIYGyAJGh4aTquiEK2y6AYd6Pn5O/j3lUL+SAiyyxn OBEkBCLNDBsqHfweoFfQTr6SLQ+i7y0NwiXhyT86ZSSt8i1t+bdDwkDAAO9h4qD2 xSH/xIY7AU7I38CvubMrlFHzVYy1cNa0FkiqKdnQN+RF3tNCFKfKfcvS+T4t+9DR 5O6/K4pBKPT0Yw0yVNtPhuHbC46gpevZAGlBy7GUrsyXhu1IGi1SZzetJBZKwhz1 /VAqDVFjdarLwM9wvTEmvU4ewym5xtgh9hBX/+jmzjDPVARPKUu2rEFscbmKC3SK rmPvJwenCH2FObNgh2WAbTcJzDdjQ7mqhUXYtH4KCyXAEIWVErTgb+2ZPO3m39iE 7mAtAnIlL0zZAT7wyr0icKzu2c8llFYHkv+v4tnGmd4bG5L3wR4= =T5oL -----END PGP SIGNATURE----- --ZTtmoRa3RpyP27k4--