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.96) (envelope-from ) id 1wk82q-000UQh-02 for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Jul 2026 22:25:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wk82n-00A626-1a for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Jul 2026 22:25:33 +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.96) (envelope-from ) id 1wk82n-00A61w-0Y for pgsql-hackers@lists.postgresql.org; Wed, 15 Jul 2026 22:25:33 +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.98.2) (envelope-from ) id 1wk82j-00000000UKp-0EBe for pgsql-hackers@postgresql.org; Wed, 15 Jul 2026 22:25:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 66FMPNh53590906; Wed, 15 Jul 2026 18:25:23 -0400 From: Tom Lane To: Jeff Davis cc: Chao Li , pgsql-hackers@postgresql.org Subject: Re: Small patch to improve safety of utf8_to_unicode(). In-reply-to: <55491ca4edb3a78ecd62b8d313eca7dd57de5e79.camel@j-davis.com> References: <541F240E-94AD-4D65-9794-7D6C316BC3FF@gmail.com> <313BCA0E-2E74-4EB6-9AA8-10DB7F439151@gmail.com> <592441c1d871a4ed0ac1708e132f447caa35869c.camel@j-davis.com> <3058CAA1-40E0-4098-893B-615F77CD35E1@gmail.com> <0cedb517aee8b79b8e31a4e42885ed88c2a67c5f.camel@j-davis.com> <16CAD4DB-9D4A-481A-BB4E-78775C4F4B2C@gmail.com> <3213927.1783950167@sss.pgh.pa.us> <3228110.1783963143@sss.pgh.pa.us> <32! 28230.1783963239@sss.pgh.pa.us> <765830662fd26e0861189c775443fc76ea8213da.camel@j-davis.com> <55491ca4edb3a78ecd62b8d313eca7dd57de5e79.camel@j-davis.com> Comments: In-reply-to Jeff Davis message dated "Wed, 15 Jul 2026 14:39:11 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3590904.1784154323.1@sss.pgh.pa.us> Date: Wed, 15 Jul 2026 18:25:23 -0400 Message-ID: <3590905.1784154323@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis writes: > On Mon, 2026-07-13 at 20:26 -0700, Jeff Davis wrote: >> Attached a patch. I added some perl code to check that the expansion >> factor of the UTF8 representation doesn't exceed 3, and added a >> static assert in the C code to compare to MaxAllocSize. > I plan to commit this soon. Only to master, unless you'd like me to > backport to silence some coverity warnings. Master seems sufficient. regards, tom lane