|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-03-06 01:14 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2016-03-06 01:14 UTC] requinix@php.net
[2016-03-06 02:53 UTC] hanno at hboeck dot de
[2016-03-06 03:37 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Description: ------------ Trying to match a certain regular expressions with large enough inputs can crash php. The example below is a simplified testcase, but this happened on a real production system with real code (feedwordpress). (On different systems the size I had to use to crash was different, but 15000 was large enough to crash on all systems I tested) This happens with 5.6.18 and 5.5.32. Interesting: With php 7 I can only reproduce it on some systems, on others it never crashes, even with insanely large inputs. There are existing bug reports that indicate they relate to a similar problem, but they all refer to windows. It's a stack exhaustion, probably related to pcre's limits. I think the limits should be set in a way that they don't crash in default situations. Test script: --------------- <?php preg_match("/(0)*/",str_repeat("0",15000)); Expected result: ---------------- Don't segfault. Actual result: -------------- Segfault.