Bug #77726 [Com]: PCRE2 does not support NULs in patterns

From: Date: Thu, 17 Feb 2022 22:30:36 +0000
Subject: Bug #77726 [Com]: PCRE2 does not support NULs in patterns
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239861@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77726&edit=1 ID: 77726 Comment by: tobil4sk at outlook dot com Reported by: 605036592 at qq dot com Summary: PCRE2 does not support NULs in patterns Status: Open Type: Bug Package: PCRE related Operating System: CentOS-7.4-x86_64 PHP Version: 7.2.16 Block user comment: N Private report: N New Comment: PR to address this bug: https://github.com/php/php-src/pull/8114 Previous Comments: ------------------------------------------------------------------------ [2021-02-18 02:18:03] antonino dot spampinato86 at gmail dot com Null pattern nice job https://3v4l.org/LluRm ------------------------------------------------------------------------ [2020-10-27 15:19:48] cmb@php.net > I assume the restriction is purely technical, […] It seems so. Some code in pcre_get_compiled_regex_cache_ex() is not binary safe (i.e. it assumes that a NUL byte terminates the pattern), and there may be further modifications needed to php_pcre.c. ------------------------------------------------------------------------ [2019-03-13 04:19:41] requinix@php.net I assume the restriction is purely technical, so if we can lift it with PCRE2 then that's probably the right answer. ------------------------------------------------------------------------ [2019-03-13 04:16:13] 605036592 at qq dot com hello cmb@php.net, I think "/a".chr(0)."bc/" != '/a\\0bc/', so not the same question! ------------------------------------------------------------------------ [2019-03-12 17:22:17] cmb@php.net PCRE2 supports NUL bytes in patterns, so we may want to lift the current restriction. OTOH, preg_match('/a\\0bc/', 'abc') already works as expected. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=77726 -- Edit this bug report at https://bugs.php.net/bug.php?id=77726&edit=1

« previous php.bugs (#239861) next »