php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eugeny at zadevalov dot com
New email:
PHP Version: OS:

 

 [2006-12-21 10:14 UTC] eugeny at zadevalov dot com
Description:
------------
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.

Contents:
===
php_value memory_limit 999M
===

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

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

?>
===

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

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

3.
With 99999M I have:
===
99999M128M
===

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. :-)


Patches

Pull Requests

History

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
http://pecl.php.net/get/htscanner


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 03:01:26 2024 UTC