|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-01 20:23 UTC] nlopess@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
Description: ------------ Both PHP 5.2.0 (pcre 6.7) and 5.1.6 (pcre 6.6) have this problem: A working pattern segfaults on certain user data. Could be stack overflow in pcre_exec/match. This patterns is almost straight from the documentation: /\{(?:(?>[^{}]+)|(?R))+\}/Us Basically to match nested {} (instead of parentheses) I found a simple workaround to the particular problem I have, but the code should not segfault. Note if you change the 12000 in the code to anything less than 8158, it will produce the correct result. Reproduce code: --------------- <?= preg_match('/{(?:(?>[^{}]+)|(?R))+}/Us', '{open'. str_repeat('.', 12000) .'{open}'), "\n"?> Expected result: ---------------- 1 Actual result: -------------- Segmentation fault