php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60626 filter_var crash
Submitted: 2011-12-29 22:29 UTC Modified: 2012-01-02 22:17 UTC
From: stephanvanruth at gmail dot com Assigned: pajoye (profile)
Status: Not a bug Package: *General Issues
PHP Version: 5.4.0RC4 OS: Win 7 x64
Private report: No CVE-ID: None
 [2011-12-29 22:29 UTC] stephanvanruth at gmail dot com
Description:
------------
Crash when a string longer than 225 characters (while containing @) is passed to filter_var

Test script:
---------------
filter_var('the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org', FILTER_VALIDATE_EMAIL);

Expected result:
----------------
return the input given

Actual result:
--------------
crash

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-31 11:14 UTC] pajoye@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: pajoye
 [2011-12-31 11:14 UTC] pajoye@php.net
It sounds to me like your stack is too small, are you using it within Apache?

Can you try in CLI using php.exe t.php and then using php.exe -n t.php please?
 [2011-12-31 14:02 UTC] stephanvanruth at gmail dot com
-Status: Feedback +Status: Assigned
 [2011-12-31 14:02 UTC] stephanvanruth at gmail dot com
t.php:

<?php
$mail = filter_var('the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org', FILTER_VALIDATE_EMAIL);
file_put_contents('test.txt', $mail);
?>

Success!
test.txt has been created and contains the given string.

works with both:
php t.php
php -n t.php

Thnx for this, whenever I 'think' I have found a bug, I will try this first.
I'm gonna google "Apache stack too small" now.

Happy New Year!

Stephan
 [2012-01-02 22:17 UTC] pajoye@php.net
-Status: Assigned +Status: Bogus
 [2012-01-02 22:17 UTC] pajoye@php.net
See http://msdn.microsoft.com/en-us/library/xd3shwhf(v=vs.71).aspx

And no, no need to assign to me, there is no bug.

We do not control how apache is built nor how it is configured (stack size 
option).

Cheers.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC