From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by sourceware.org (Postfix) with ESMTP id CE0BA3857732 for ; Sat, 22 Apr 2023 02:22:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE0BA3857732 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=nabijaczleweli.xyz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nabijaczleweli.xyz Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id B13C06936 for ; Sat, 22 Apr 2023 04:22:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1682130154; bh=YQ+x8umBfB6VM5bWNfR2REZINYkyc44PMyROe04KAkM=; h=Date:From:To:Subject:References:In-Reply-To:From; b=JKUkmYmEY/l90vwtsWanhd2tTIbayTOCTNdMpdzzVd4dS/MgL3RGMARhWal7+jh8E 3fOM2jlj8+ppBsf8FxcaedX31KMIw1LjHV+JC9JvVcFXz8iBdEx3JjL157Cf8n36QB xrcE0Mg5oi4LfxySeO4RccqQf/EqTZIrYNQVkUsodppkTrh1MVP69lzRtpsMIJtfAM k49jNtTwcDNypQcKXdlQHgwUwFiPWi2oNxN7cRdrxBE9lxr/dHG6KGI+oZJBlMxVGD VpPMEg4cUms+U3trHoielwaT/bRicTSiz7hb4fBrVB2dMiwvOKJiojzL3XyEkkwMdV nR40MEP0VGp1g== Date: Sat, 22 Apr 2023 04:22:33 +0200 From: =?utf-8?B?0L3QsNCx?= To: libc-alpha@sourceware.org Subject: [PATCH 2/3] posix: regcomp(): clear RE_DOT_NOT_NULL Message-ID: References: <6ae8f638ecd1a0f0d76a104c8903baf96ecd317a.1682130047.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rwzpsek32s3cchcu" Content-Disposition: inline In-Reply-To: <6ae8f638ecd1a0f0d76a104c8903baf96ecd317a.1682130047.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20230407 X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --rwzpsek32s3cchcu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The POSIX API always stops at first NUL so there's no change for that. The BSD REG_STARTEND API, with its explicit range, can include NULs within that range, and those NULs are matched with . and [^]. Heretofor, for a string of "a\0c", glibc would match "[^q]c", but not ".c". This is both inconsistent and nonconformant to BSD REG_STARTEND. With this patch, they're identical like you'd expect, and the tst-reg-startend.c: ..c: a^@c: no match$ failure is removed. Another approach would be to remove it from _RE_SYNTAX_POSIX_COMMON, but it's unclear to me what the custody chain is like for that and what other regex APIs glibc offers that could be affected by this. Signed-off-by: Ahelenia Ziemia=C5=84ska --- Please keep me in CC, as I'm not subscribed. posix/regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posix/regcomp.c b/posix/regcomp.c index 647b18ba9e..cbd9bfc673 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -462,7 +462,7 @@ regcomp (regex_t *__restrict preg, const char *__restri= ct pattern, int cflags) { reg_errcode_t ret; reg_syntax_t syntax =3D ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTEN= DED - : RE_SYNTAX_POSIX_BASIC); + : RE_SYNTAX_POSIX_BASIC) & ~RE_DOT_NOT_NULL; =20 preg->buffer =3D NULL; preg->allocated =3D 0; --=20 2.30.2 --rwzpsek32s3cchcu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmRDROkACgkQvP0LAY0m WPHqaw//SxeEPPmR7C780RJJ7BSTqaS0XgVhLa/4zn0IgKtbPVh4sWFcZFOi+7nJ JMtbopg3SG5qXjUD8Z8LWrI8aSmcc4FSzURz5ICL7lC7TJv3clnbk9H591NnHVvt s/fgawXp8DQv+mkag2AhU66J128zl0rP3jZ6bAFUxxk9L3C5R49RGmAVDs+Sx+sV dSHtvhMlFtQm8h7w718SRYJjkGDLdUQzc6wQTmZ+YuY1gGNVrQaMLq0wS8gNpJqI sKdw0ero5DTDHlyCbPSF3NWn4HKQbxauscJMxSP68pybsFj4oVPQuYCmX17E7tk8 htyRPF2NHQJDisHQW4A9sjZKVA6ftr4KQRl0mUgcZOZJEiKASDSuLgNVwGM4fU80 6S6oM+fk0B0Fahzl6g8iXpKMb5LCFB7VFI/73i+ubSf1yOlc+xMCrv5fWWBNnYvA pPt/xUd9dl7YIYPP/pJ+i8RXwUckYxPuQUAqtL14GgEdP2jOcYoxcHKat+m20G+e UIha8StzHx46Q9RgjHraZsYB/LuPwMmrA3LFGlVKHR3wlcDF6OsqFnQ6IyKWSPMw poF+TXGi2z1aVCoO6VpdVMIuuda+OHs7zgCG2fhzXnwYbiEn1inqg0sQ8AyLQVn2 U8VxU/1ktTGD7SdAV+BdTbX72wJQ5mkLm5gkyLFgSm1T3eLbxvM= =ta9j -----END PGP SIGNATURE----- --rwzpsek32s3cchcu--