From:
Operating system: Linux Debian
PHP version: 5.3.3
Package: Filter related
Bug Type: Bug
Bug description:Crashes when I try to filter a text of > 2264 characters
Description:
------------
The server crashes if I want to filter a string which has more characters
than
2264.
The string in my test-code below contains 2265 characters.
If I call this script using the apache-php-mod I get an empty response.
Otherwise if I call this script by using the command-line it crashes either
- but
now I get the error-message: Segmentation fault
I have tested some other filters and it's only FILTER_VALIDATE_EMAIL who
crashes
in my tests.
You can check the length of the string first by using this information:
http://email.about.com/od/emailbehindthescenes/f/address_length.htm
Test script:
---------------
<?php
$extremeString =
'01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234';
echo filter_var("test@example.com", FILTER_VALIDATE_EMAIL) ? "good\n" :
"bad\n";
echo filter_var("test#example.com", FILTER_VALIDATE_EMAIL) ? "good\n" :
"bad\n";
echo filter_var("$extremeString", FILTER_VALIDATE_EMAIL) ? "good\n" :
"bad\n";
echo "DONE.";
Expected result:
----------------
good
bad
bad
DONE.
Actual result:
--------------
good
bad
Segmentation fault
--
Edit bug report at http://bugs.php.net/bug.php?id=53091&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53091&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53091&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53091&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53091&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53091&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53091&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53091&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53091&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53091&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53091&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53091&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53091&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53091&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53091&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53091&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53091&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53091&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53091&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53091&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53091&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53091&r=mysqlcfg