php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58375 Not removing single/double quotes from the value
Submitted: 2008-10-11 22:40 UTC Modified: 2009-03-03 20:31 UTC
From: np at yourserveradmin dot com Assigned:
Status: Closed Package: htscanner (PECL)
PHP Version: 5.2.5 OS: GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: np at yourserveradmin dot com
New email:
PHP Version: OS:

 

 [2008-10-11 22:40 UTC] np at yourserveradmin dot com
Description:
------------
If an ini value is quoted with ' or "  - they are not removed.

Reproduce code:
---------------
Simply:
php_value memory_limit "32M"

which makes PHP crazy (mem limit is 0, any mallocs fail etc)

The patch:
--- a/htscanner.c
+++ b/htscanner.c
@@ -133,6 +133,17 @@ static void value_hnd(char *string, int flag, int status, HashTable *ini_entries
                        }
                }

+               if (len > 1) {
+                       if (*value == '"' || *value == '\'') {
+                               if (*value == value[len - 1]) {
+                                       value[len - 1] = 0;
+                                       len--;
+                               }
+                               value++;
+                               len--;
+                       }
+               }
+
 #define _CHECK_PATH(var, var_len, ini) php_htscanner_ini_check_path(var, var_len, ini, sizeof(ini))

                /* safe_mode & basedir check */


Expected result:
----------------
just:
32M



Actual result:
--------------
actually:
"32M"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-03 20:31 UTC] pierre dot php at gmail dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 17 09:01:25 2018 UTC