Received: from [217.196.149.56] (helo=malur.postgresql.org) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sfMwf-005GSU-25 for pgsql-bugs@arkaria.postgresql.org; Sat, 17 Aug 2024 17:10:29 +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 1sfMZY-004kTm-Rx for pgsql-bugs@arkaria.postgresql.org; Sat, 17 Aug 2024 16:46:37 +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 1sfMZY-004kQe-JM for pgsql-bugs@lists.postgresql.org; Sat, 17 Aug 2024 16:46:37 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sfMZV-0009oK-Pe for pgsql-bugs@lists.postgresql.org; Sat, 17 Aug 2024 16:46:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 47HGjWsR964775; Sat, 17 Aug 2024 12:45:32 -0400 From: Tom Lane To: exclusion@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18585: Date/time conversion functions are not protected against integer overflow In-reply-to: <18585-db646741dd649abd@postgresql.org> References: <18585-db646741dd649abd@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 17 Aug 2024 15:00:01 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <964773.1723913132.1@sss.pgh.pa.us> Date: Sat, 17 Aug 2024 12:45:32 -0400 Message-ID: <964774.1723913132@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > The date/time conversion functions do_to_timestamp(), DCH_from_char(), > ... lack reliable checks for integer overflow in the input components. It's pretty hard to get excited about that, given that the overflow limits are so many orders of magnitude beyond the useful input range. There are plenty of garbage-in-garbage-out scenarios associated with (mis)use of the to_xxx functions, and this feels like just another one. If anybody does feel excited about the topic, I'm not going to stand in their way ... but I'm not excited. regards, tom lane