#38401 [Opn->Fbk]: preg_match segfaults with large negative lookaheads (pcre bug)

From: Date: Wed, 09 Aug 2006 19:16:37 +0000
Subject: #38401 [Opn->Fbk]: preg_match segfaults with large negative lookaheads (pcre bug)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100605@lists.php.net to get a copy of this message
ID: 38401 Updated by: tony2001@php.net Reported By: ibexris at gmail dot com -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: FC5 PHP Version: 5.1.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2006-08-09 18:50:01] ibexris at gmail dot com Description: ------------ This is a rehash/update of Bug #27525 (http://bugs.php.net/bug.php?id=27525), which I can't update (you guys really need a way for new people to add comments to existing tickets). Not sure if the original submitter ever emailed Philip, but after bumping my head against this problem yesterday, I contacted him myself. He is now able to reproduce the bug in the current version of pcre (6.7), and expects to have a fix sometime in september or october (the first chance he'll have to actually look at the code). I've created this new ticket because there will be a pending fix upstream. fyi, better code to reproduce: <?php $string = str_repeat('x', 11000); $pattern = '/(.(?!b))*/'; echo preg_match($pattern, $string); ?> And a workaround, since none was posted before: <?php $pattern = '/(.(?!b)){0,540}/'; ?> You can't go above 540 because preg_replace complains about the pattern being too large. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38401&edit=1

« previous php.bugs (#100605) next »