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 1pyxqC-0006Rk-D5 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 May 2023 16:48:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pyxqB-0004mm-0P for pgsql-hackers@arkaria.postgresql.org; Tue, 16 May 2023 16:47:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pyxqA-0004mQ-HA for pgsql-hackers@lists.postgresql.org; Tue, 16 May 2023 16:47:58 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pyxq7-0009s5-5f for pgsql-hackers@lists.postgresql.org; Tue, 16 May 2023 16:47:57 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6439bbc93b6so10172740b3a.1 for ; Tue, 16 May 2023 09:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1684255674; x=1686847674; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=vA9Ckr0w9gHmwNmSfRQXMdX+RMb0gLo48gHaJMdiM9Y=; b=b9ISS1uATyVeIqF4szvFQ7jQE3wULIdqzgSgk1Y6DgPNBrNJuN36ETt/TTTi3Rhaw3 SjcrcXpsDQrMhW+5IPIi10otlp6ECAjgnFH4/2sBgbLd2I6LS6Hjn73an4kEqjAnIkul hBDVtb3R4Zpi1vVB0AIp7BNP9HgstX88azxxTyUpks2biKCt7Zs0VHZKyhUfDfL7gENb 9BJUPADkUBUIGHpDX6UR5mIcV6SnSchOYcnO3h3OtRWxtB6/4RKFCZrRYO2i3+g1lOVj QQhNdJh7jqt/o55vXQ2nZ53T9fd32gmNV3ES+eG+FoGk+OomWlr6fTZxLIRGwZypvp3U i/Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684255674; x=1686847674; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vA9Ckr0w9gHmwNmSfRQXMdX+RMb0gLo48gHaJMdiM9Y=; b=X6jpE8eZWHA5q+1FBRmHkYfndsp3SOQ4Y2da5zvplrKHZz4ww0DPb3wl6n4/cluIQd +A3eyo1pDsNmAWEU8ddEdJHn1MoeBKMI9GQnyUG7+zsXlsNkYxqjl/BE73kUZXJK+PBP UdalSmvPMBX3QHsZWGkMkOuVRDxEG4hy4+RExdl4gZA5gevMUmCFgl9/2yu41fohZKs5 vLAcjePu2qLS6XJI4RwRWvwIbo1chhh0GSAOFWTdoqjABXWGakVnAU8DtxGY1OEKsnNH apfR2INxS4Mc3l2aMATMIafQFYsyqXoFfqlkcrKISXqCAK+cx2tbprTFKiZtDDDRgyv7 zbwA== X-Gm-Message-State: AC+VfDwkjmwMgIpMsBwLBcOSgI9vmsTQQ5CkbEQtOX+AnDl/gatPtQob cO/6slybfZqqlg8rt+/su1/39A== X-Google-Smtp-Source: ACHHUZ53nWaazPsQUVJeFVenwMaK0Prf0im26DK8bFlXYpvb5T7YtuAkD3BiWr+RduQdGliYsNJKjQ== X-Received: by 2002:a05:6a00:248d:b0:626:29ed:941f with SMTP id c13-20020a056a00248d00b0062629ed941fmr52188526pfv.5.1684255674186; Tue, 16 May 2023 09:47:54 -0700 (PDT) Received: from [172.18.7.14] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id a26-20020a631a1a000000b0053423447a12sm3697981pga.73.2023.05.16.09.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 09:47:53 -0700 (PDT) Message-ID: <504bc10a9ad8d143f505e66be2a0060e50b45677.camel@j-davis.com> Subject: Re: Order changes in PG16 since ICU introduction From: Jeff Davis To: Alexander Lakhin , Tom Lane Cc: Daniel Verite , Andrew Gierth , Peter Eisentraut , Sandro Santilli , Regina Obe , pgsql-hackers@lists.postgresql.org Date: Tue, 16 May 2023 09:47:51 -0700 In-Reply-To: References: <543e4ce6-8205-4aea-b54b-12b9ef747bf6@manitou-mail.org> <654a49f7ff7461bcf47be4181430678d45f93858.camel@j-davis.com> <37520ec1ae9591f83132f82dbd625f3fc2d69c16.camel@j-davis.com> <483826.1683582475@sss.pgh.pa.us> <2098874d-c111-41e4-9063-30bcf135226b@gmail.com> <91c0cdd2a402d59f8d6eaac40862d6f68e0b937c.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2023-05-16 at 19:00 +0300, Alexander Lakhin wrote: > I'm not sure about the proposed change in icu_from_uchar(). It seems > that > len_result + 1 bytes should always be enough for the result string > terminated > with NUL. If that's not true (we want to protect from some ICU bug > here), > then the change should be backpatched? I believe it's enough and I'm not aware of any bug there so no backport is required. I added checks in places that were (a) checking for U_FAILURE; and (b) expecting the result to be NUL-terminated. That's mostly callers of uloc_getLanguage(), where I was not quite paranoid enough. There were a couple other places though, and I went ahead and added checks there out of paranoia, too. One was ucnv_fromUChars(), and the other was uloc_canonicalize(). Regards, Jeff Davis