Re: PHP 4.0 Bug #2670: ereg causes segfault
| From: | Lars Torben Wilson | Date: | Fri, 05 Nov 1999 18:46:29 +0000 |
| Subject: | Re: PHP 4.0 Bug #2670: ereg causes segfault | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-12142@lists.php.net to get a copy of this message | ||
roberts_chris@yahoo.com writes:
> From: roberts_chris@yahoo.com
> Operating system: Solaris 7 x86
> PHP version: 4.0 Latest CVS (05/11/1999)
> PHP Bug Type: Misbehaving function
> Bug description: ereg causes segfault
>
> ereg is crashing apache when the variable data begins with a ".".
> There are probably better ways to do this, but , it does work with ALL
> previous versions tested. Not able to get a core dump or backtrace.
>
> Soalris 7 x86 on PII 400
> Apache 1.3.9 with PHP as DSO
>
> ./configure --with-apxs=/opt/apache/bin/apxs --with-config-file-path=/opt/apache/conf
> --without-gd --with-yp --with-ldap=/opt
>
> **********************************************************************************
> <html>
> <head><title>Ereg Test</title></head>
> <body>
> <?
> $testvar=".bunk variable data";
>
> if ( !ereg( "^\.+", $testvar) ) {
> echo "<h2>Testvar passed regex</h2>\n";
> }
> ?>
> </body>
> </html>
OK, just for informational purposes: this doesn't crash on PHP
3.0.13-dev or 4 for me (Linux, glibc, Apache 1.3.6). However, the '!'
in front of the regex inverts the logic, which may cause it to look a
little like it's not working; try removing it and see what you get.
If you're getting an actual segfault in apache (i.e. 'Document
contains no data' then that's a different story...:)
Torben