Bug #18399 Updated: eregi function causes apache to crash that page

From: Date: Thu, 18 Jul 2002 06:16:07 +0000
Subject: Bug #18399 Updated: eregi function causes apache to crash that page
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14494@lists.php.net to get a copy of this message
ID: 18399 Updated by: edink@php.net Reported By: peter@600ml.com.au -Status: Open +Status: Closed Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.2.1 New Comment: If you recompile php without "--with-system-regex" option the problem will go away. Previous Comments: ------------------------------------------------------------------------ [2002-07-17 20:24:04] peter@600ml.com.au php configuration: -------------------------------------- './configure' '--with-apxs=../../psa/apache/bin/apxs' '--prefix=../../psa/apache' '--with-system-regex' '--with-config-file-path=/usr/local/psa/apache/conf' '--disable-debug' '--disable-pear' '--enable-sockets' '--enable-track-vars' '--without-gd' '--with-mysql=../../psa/mysql' '--with-iodbc=../odbcsdk' '--with-imap=../imap-2001a' '--with-pgsql=/usr/local/pgsql' -------------------------------------- here is a script that will crash the page: <?php function detect_browser() { if(eregi("(opera) ([0-9]{1,2}.[0-9]{1,3}){0,1}",$_SERVER['HTTP_USER_AGENT'],$match) || eregi("(opera/)([0-9]{1,2}.[0-9]{1,3}){0,1}",$_SERVER['HTTP_USER_AGENT'],$match)){ $BName = "Opera"; $BVersion=$match[2]; }else{ $BName = "nothing"; } return $BName; } $browser = detect_browser(); print $browser; ?> you can see it in action here: http://www.600ml.com.au/test2.php ------------------------------------------------------------------------ [2002-07-17 19:59:38] sniper@php.net And how was PHP configured? (you can find the configure line in phpinfo() output) ------------------------------------------------------------------------ [2002-07-17 19:58:57] sniper@php.net Can you please give us a short but complete example script which we can use to reproduce this? ------------------------------------------------------------------------ [2002-07-17 19:27:30] peter@600ml.com.au what you did: ran a php script on a apache/linux server that ran a million times before perfectly well on the same set-up with a lower version of php what you expected to happen: the script to run present me with a page what happened: the below browsers spat out the errors as described below i narrowd down the code and noticed that the apache error message and the resulting "no data" pages occured only if the "eregi" function was present in the script ------------------------------------------------------------------------ [2002-07-17 18:52:06] sniper@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ------------------------------------------------------------------------ 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 http://bugs.php.net/18399 -- Edit this bug report at http://bugs.php.net/?id=18399&edit=1

« previous php.bugs (#14494) next »