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 1wBtHg-001T9n-20 for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2026 11:47:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBtHe-0025bE-35 for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2026 11:47:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBtHe-0025b6-0A for pgsql-hackers@lists.postgresql.org; Sun, 12 Apr 2026 11:47:23 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wBtHc-00000000d72-2zHi for pgsql-hackers@lists.postgresql.org; Sun, 12 Apr 2026 11:47:22 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 8AEF4EC03FA; Sun, 12 Apr 2026 07:47:19 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Sun, 12 Apr 2026 07:47:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1775994439; x=1776080839; bh=RKkOM6rldJ iGeV6NPu2mUc0iS1/SR4QlFW0tYFf50tk=; b=fZ24eYrA+F4/iD0p5JHfeyAbCJ m2DufUCVLIYNMTKrnSY4frOWk5Fhgi2krcgiV0/SWXJ/7ogChKmZA/8+kBQsEA+f slmmSHhKsaDieA6RGCAXet5zYnwLV+mTdXqt27geXn/IqMShVk4e6U0CpVFBCFj6 pVpCRh/2KgRPFTWnMYBxhS2CNrNiXqfK5QIiLTOKvxlz6j3OdGV37ULdx33rqfv4 7JQG81wU3GIlf3h2wnW3QTF0f2tWsPb5VPV23EPeWD1MtLuq1rweGkeuyJDEsOB0 3NWeoZUaSW9begdc96xzgEdZy2wsxZdw3Uabd6HPnFhWZoy2Q17l8RLnMn6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1775994439; x=1776080839; bh=RKkOM6rldJiGeV6NPu2mUc0iS1/SR4QlFW0 tYFf50tk=; b=XvuMV00+O8SsNQJzhMe2S4mgHNnu/EXUGIDuoeFl3sIa3MRd2Vb 5NsihgzU74HcALBzg2zaX0vowG/t77X6h57Bw0oKzxfXxIwX32ZFzLl8EbOO+4II MJWLnA3969Vu90z33MXIzRi1iPiLxwr1DtQeunVMG1DDED3+rx4TlbiftVQsfHdP KUYUj+qNDMhaLejEdap3LvueEjIoJrs2bE+17UD/+sH5JBuLZHmiIDsEuW3U+lmd h++OumGsK+rMXx/TLHfUdQKUy+QPUzIg2l5ihIqiXEsfueQUERGhRMi2K/wxFV7U 4EWGsI9aUoDvNH+H/IY4ju2VVLE4jCuouPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdefhedvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtroertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeffudelheeghfekfefgfedthfekuddt vdfhudekgeegheeikefflefhleekheetfeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvgigtlh hushhiohhnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepjhhohhhntghnrgihlhhorhhl shesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlih hsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 12 Apr 2026 07:47:17 -0400 (EDT) Date: Sun, 12 Apr 2026 20:47:10 +0900 From: Michael Paquier To: Alexander Lakhin Cc: John Naylor , Postgres hackers Subject: Re: Non-compliant SASLprep implementation for ASCII characters Message-ID: References: <09df9d75-13e7-45fe-89af-33fe118e797b@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SExyRugIOR8XTpfp" Content-Disposition: inline In-Reply-To: <09df9d75-13e7-45fe-89af-33fe118e797b@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --SExyRugIOR8XTpfp Content-Type: multipart/mixed; boundary="fWquZpxsE0UPsxSZ" Content-Disposition: inline --fWquZpxsE0UPsxSZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Apr 12, 2026 at 09:00:00AM +0300, Alexander Lakhin wrote: > That is, strlcpy() tries to evaluate strlen() for src, which contains only > one byte without null terminator. Thanks for the report. I don't know why skink is not complaining, but I do see the failure, and I am able to fix it with the attached. Does it work on your side? -- Michael --fWquZpxsE0UPsxSZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=saslprep-test.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/test/modules/test_saslprep/test_saslprep.c b/src/test/modu= les/test_saslprep/test_saslprep.c index 70ff7069bf70..121212d4fa21 100644 --- a/src/test/modules/test_saslprep/test_saslprep.c +++ b/src/test/modules/test_saslprep/test_saslprep.c @@ -84,7 +84,8 @@ test_saslprep(PG_FUNCTION_ARGS) * Copy the input given, to make SASLprep() act on a sanitized string. */ input_data =3D palloc0(src_len + 1); - strlcpy(input_data, src, src_len + 1); + memcpy(input_data, src, src_len); + input_data[src_len] =3D '\0'; =20 rc =3D pg_saslprep(input_data, &result); status =3D saslprep_status_to_text(rc); --fWquZpxsE0UPsxSZ-- --SExyRugIOR8XTpfp Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnbhj4ACgkQnvQgOdby QH1PKhAAlu9aA9GxgmSJb1oiGB1KtKLk0VwQr8rFCm52QV5BkYhwjrPETSUTs8JS 6pq8DW8QVPr+wwL8pYmnHaOSPLf/KjADwgB9dEGTa+RWlmpptdCrsVDHfaE2hAdc MolHR1OOP+xVa+jptqOBywIn2V7EycBh5STmwbTi3mVBt4YHUP7IcIq2+BgyPFVM 4cBNh4LEvqMTCbPj5eqDW1+D4f68cQ3dztW+pfNqNzEWTEsCDv/z3lb8YDQbBT47 uGKVo10YHrEEGzoVl0q35gVIdUySO4uNEZ2SbkEEk99rEp+4Lu3EHO4uwXurFzmO RlacJFrso0pQj8O3MUV49KaYOYP/FJMzGhqpPOmRfQQYbLVE3NPeJO8KoN0AAn7j bvrQypgY1nQWYe8nw3JU9PUuB3+9N46dYD8pH494LephYK/xavc+ZuNIDEWTQ2X0 NdlDiLksyEjPURU9V3wpCyGEF/WXzb2/qyK7Z1eQ9FwlNOfUgA21GshpS/Jf/+S6 1/07ju6SJ9ULrduy2RUtetAgIdRDrKICDoZ4C0zFKpSk9uleDlnMujCmoLovHqY7 elGUslsL3YpEqc4bkRYC/xY8Ua66ljt+qz9Yr+vtEfTir+W69NB9aTogA03j7yLZ PiikVBaQ/WCNCGwsfy3Sqz85BXd3ssARUMZFFJYPjag8Mp0Ejio= =NH5R -----END PGP SIGNATURE----- --SExyRugIOR8XTpfp--