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 0A4AA3854176 for ; Fri, 28 Apr 2023 12:36:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A4AA3854176 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 5EB0A6CE6 for ; Fri, 28 Apr 2023 14:36:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1682685403; bh=1NMzJKlxYGRoufZMD/GwViTEOyiTUy0v2qqBoOCsr0E=; h=Date:From:To:Subject:References:In-Reply-To:From; b=IOUfojaOu9c61OsgCeVIs2Dy2CB2zBOQI+0cJ0yFrR2aFriYwOzdLd1uhrCRuCppw VmJfcp6Y/neaqVty1MYo0caCz4B2/FfSKaqzmyDMLW0hJejTELiAHGbHIlFIRT/p4P NHcF6KnFpybRrYc6vbSVAX/kSFnP5P5xoVfMEqznoYw7ZsSrqULs8iRYmLc+OgY1QI 12YLsraEs75AqlfJr2b2gUQnj/Dv0l1fQw5QwayjDgKP4vnKXk2a569X4dEBa6ZKJs KxhdqpuNIppxubHWXN4+FOmXHcC81vdTy+Tdpiy39mpofJadYPyFqndZRya62jgbAf qbc9u6KexBrng== Date: Fri, 28 Apr 2023 14:36:42 +0200 From: =?utf-8?B?0L3QsNCx?= To: libc-alpha@sourceware.org Subject: [PATCH v3 2/3] posix: regcomp(): clear RE_DOT_NOT_NULL Message-ID: References: <9dee3d2ba84f09e883cf7a7dfcda486fda735382.1682685278.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ttpwgxoia3oyciy2" Content-Disposition: inline In-Reply-To: <9dee3d2ba84f09e883cf7a7dfcda486fda735382.1682685278.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20230407 X-Spam-Status: No, score=-9.8 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: --ttpwgxoia3oyciy2 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 --- Keep me in CC, please. 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 --ttpwgxoia3oyciy2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmRLvdkACgkQvP0LAY0m WPHJnRAAq594+rsSWnN1CM3ko+uTheKRXweZxTZA+DvI6js0DVFeXSZvvL4e3kfR 1eOqzeUR5yFmuEU8z1e+xUD4oJFRv39LY7zyZjO51nNQPFfrP/uWu6Vn+sWlApxV aO3hl4SEg6FlLVSOZb/kJYiJnVIIkHO/PZsOsqi22OuYrr8etXCVFfM/l/by9ihj 9yyJkvaoTn9h3wEr46z90kpv6LT8BK2dj86cFHooowbYSN2vk+CVbZaW5BdnSG0h y/Il1rBa7ufNNL/viKSP75qBtA+6sa5E0f/wUSpoQx+hVDZuL5NOUzFdcPm/T9jo Bc/SOvBvoB7IDCVviypyx6Ka2xPYPR5zO3aAa9GrCYJ9Q90Vo42MlvLHEOI0ojxG AVI0IyRTZZ7fRe13KNPdqvUbVwOPy/bIdCaisDM2+wcJ2CTVgdZapVWtMIFnSQB+ 3nhn4zRDaCu2o9QVj4uF+Us0B/C+df2v9jWJWiKbkMeHhjr9+NLrV4jQeRMLnBNt uhZxT1FruT3TqxujfsBVZQe3CnZKQZmmjalY/xCVwawSf/TOIf6ltndunHMVzbaV X1CY9Iry1eaViM6QlPgqlTkL0JWYWuTV7aZHICCDHSia598OODfGXgey3NOZZ36W mSzguoeiG9OLUhIpxjkn1MSWTXg5pvARAiNHpqU04b0B7Us4CAw= =ykUp -----END PGP SIGNATURE----- --ttpwgxoia3oyciy2--