php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53091 Crashes when I try to filter a text of > 2264 characters
Submitted: 2010-10-17 22:13 UTC Modified: 2010-10-17 22:19 UTC
From: SimonSimCity at googlemail dot com Assigned:
Status: Duplicate Package: Filter related
PHP Version: 5.3.3 OS: Linux Debian
Private report: No CVE-ID:
 [2010-10-17 22:13 UTC] SimonSimCity at googlemail dot com
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 = '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234';

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-17 22:19 UTC] rasmus@php.net
-Status: Open +Status: Duplicate
 [2010-10-17 22:19 UTC] rasmus@php.net
This has already been reported and fixed and will be in 5.3.4.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 08:02:33 2014 UTC