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 1wcJEP-003FdZ-15 for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 08:45:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcJEO-00GKtW-0R for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 08:45:12 +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 1wcJEN-00GKtO-2i for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2026 08:45:11 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wcJEL-000000025Iu-13Jf for pgsql-hackers@postgresql.org; Wed, 24 Jun 2026 08:45:11 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-37dedd62b90so3880a91.1 for ; Wed, 24 Jun 2026 01:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782290707; x=1782895507; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2C4QcD5a/uWBXFZJT690FinI5VCjifQOM1O9AqxqmT8=; b=IX5oS3kIn2Oi3duYMBLY1TDdNt9eDvD21s9bsTcNGmhZaKFl8G/v298nM6hkx5B+rv lWkID4EwjcGx5XYpl+nVjE9hHh+6c3a+BdLWTLZftCq2S8O913yU+9PE+T3JOHw1LjmT 8HPLGirmRi8zNZGw/d1bUmUJdIRsd6MOKbdb+dfbKcZ6nn9aKqmGJmzG3KgJV/MzabEB ziS/+R0bVUi+5e5b9u5Xr8D15TPX2EkXDwPJiz58OyynKDXpNaye9MrDnHO9mmFPFeUU 2E3cfSqTwhR9askgcpd8dsfCSsQyoVTC7ZWeGOCjCqUXhHSL409RWC2fYzmbwRjGqjST ejLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782290707; x=1782895507; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2C4QcD5a/uWBXFZJT690FinI5VCjifQOM1O9AqxqmT8=; b=XOFc5m+9dlh9V87nZKsrKpH2cAfha9zNk0QDuqN5nyCPDNbFI1tsgC/0MjAjjFTapK JJOR+LI4GzcxpA2RwLm8/jX3a6rXV+KyPCn5Z1YMoKdEkP+Erd7egNU3a9M0oVOodpwl YIb2JEqrt5XhpbmHzBH5tvxWD+1j78e0SMvxcajU6/AmYJLfjE0BfMBE809Ys7pp6niZ I5CpWU1o8PDTklK3mOXzJMf1SY1C0IxV3Ncw8TB7I4Qm03qRq7TkoEcnYb2xf3PHTeiP +mWkFbZycEsdJvv/YSI3n6gg9z3C0DCqTJ56G9x2LpRIH9erIMOfbgGCZvS/1duJkX+Q Y1eA== X-Gm-Message-State: AOJu0YwbjHnW/I9XGIvvI/jM+6fxCAEBaJWNv93/mDkGNnAdERUFf8Rx ERM6I4YrwN1bYapHJ5vML3tou793hfbA+ddODFqAjVL2Tg7K3r8x6Pw5 X-Gm-Gg: AfdE7cn3pM0UTX2r/m2Wn78XDiWH4TbxF0LFFKanSEAvYBWLVcVT/HGHunHQ3vUnbgn lhe2V7go9Vh80deyQQo+TeAdWjr9txzmjCCPRVWmDxhyV44ECxRiQyDpQ8OD6rL9QmrdjdWpzev O+QP9W3cmTwIes7oluGj4JDfZbVHmRavzmyjDyH1r4gyxJFWXeIIwyK+aTYLkp4AeQ3EofpCWbg E/wCuUUaSmbD5xXEqWe9ceeybtg5Ic8bl2/iJP+N4chQJUbx3aJvF421Dyrjqm74eo+BQCKGXih PrVaiZrO4WnvAlEkvFwzFMiV9NoQSE6qiVi8CspEU3+KX3QNF7mXIjU6RC4pQFH6d4umUwyGVcc QJy8jIISVhWpmL+LtBdNve0nQ0o6dE6jzj2Ivxch80WRpNYqTCsOLJtP64uiePEDU2qNfRx/g2o KF3SdiX56c402r3lmlgQdC7A== X-Received: by 2002:a17:90b:590d:b0:36d:86a5:5b8 with SMTP id 98e67ed59e1d1-37dcd792daemr6775579a91.11.1782290707029; Wed, 24 Jun 2026 01:45:07 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.125]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-37de3b83adasm1680584a91.10.2026.06.24.01.45.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2026 01:45:06 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: Small patch to improve safety of utf8_to_unicode(). From: Chao Li In-Reply-To: Date: Wed, 24 Jun 2026 16:44:30 +0800 Cc: pgsql-hackers@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <313BCA0E-2E74-4EB6-9AA8-10DB7F439151@gmail.com> References: <541F240E-94AD-4D65-9794-7D6C316BC3FF@gmail.com> To: Jeff Davis X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jun 24, 2026, at 13:45, Jeff Davis wrote: >=20 > On Mon, 2026-06-22 at 19:02 -0700, Jeff Davis wrote: >> v4 attached. >=20 > v5 attached. >=20 > There's an extra patch 0002 to fix a logic bug when handling final > sigma (only affects the builtin pg_unicode_fast locale), which I think > should be backported to 18. >=20 > Also added tests. >=20 > Regards, > Jeff Davis >=20 > = There is a compile warning against pg_wchar.h in 0004: ``` ../../../src/include/mb/pg_wchar.h:523:11: warning: variable 'codepoint' = is used uninitialized whenever 'if' condition is false = [-Wsometimes-uninitialized] 523 | else if (nbytes =3D=3D 4) | ^~~~~~~~~~~ ../../../src/include/mb/pg_wchar.h:540:16: note: uninitialized use = occurs here 540 | *pcodepoint =3D codepoint; | ^~~~~~~~~ ../../../src/include/mb/pg_wchar.h:523:7: note: remove the 'if' if its = condition is always true 523 | else if (nbytes =3D=3D 4) | ^~~~~~~~~~~~~~~~ 524 | { ../../../src/include/mb/pg_wchar.h:469:20: note: initialize the variable = 'codepoint' to silence this warning 469 | char32_t codepoint; | ^ | =3D 0 1 warning generated. ``` Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/