|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57450 Incorrect "php_value" argument parser
Submitted: 2006-12-21 10:14 UTC Modified: 2007-01-06 11:35 UTC
From: eugeny at zadevalov dot com Assigned: pajoye (profile)
Status: Closed Package: htscanner (PECL)
PHP Version: 4.4.4 OS: Centos4 (i386 and x86_64)
Private report: No CVE-ID: None
 [2006-12-21 10:14 UTC] eugeny at zadevalov dot com
I think the problem is somewhere in this code (static void value_hnd ...):

        if (len > 2 && value[len - 2] == '\r') {
            value[len - 2] = 0;
        } else {
            value[len - 1] = 0;

Reproduce code:
I've created sample .htaccess file.

php_value memory_limit 999M

And I'm trying to open sample test.php file:

print ini_get('memory_limit');
ini_set("memory_limit", "128M");
print ini_get('memory_limit');


With 999M I have:
Allowed memory size of 999 bytes exhausted (tried to allocate 92 bytes)

With 9999M I have:
Allowed memory size of 9999 bytes exhausted (tried to allocate 92 bytes)

With 99999M I have:

But! "phpinfo()" shows me: "memory_limit 99999M<SOME_GARBAGE_HERE>"

From what I have it appears that it ignores "M" postfix because of the garbage at the end. This garbage is probably caused by some bug in your line end detection code. I've spent some time trying to fix it, no luck... Though I don't understand why you search for '\r' and nowhere search for '\n' which is the CORRECT line end in Unix.

Expected result:
In all cases I've expected the example test.php to work. :-)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-30 10:16 UTC] pierre dot php at gmail dot com
Please try using CVS.
 [2007-01-06 11:35 UTC] pierre dot php at gmail dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue May 30 03:03:41 2023 UTC