com php-src: Fixed runtime php.ini override, ini name length is off by 1.: sapi/litespeed/lsapi_main.c
| From: | Lior Kaplan | Date: | Tue, 05 Jan 2016 21:48:42 +0000 |
| Subject: | com php-src: Fixed runtime php.ini override, ini name length is off by 1.: sapi/litespeed/lsapi_main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90519@lists.php.net to get a copy of this message | ||
Commit: 69112d7e9715c01f5276b2fb5c31f7aab6aaeef9
Author: George Wang <gwang@php.net> Thu, 19 Nov 2015 17:01:26 -0500
Committer: Lior Kaplan <kaplanlior@gmail.com> Tue, 5 Jan 2016 23:48:42 +0200
Parents: 1dc395c8c45a6b5f69eff8319cd8b9a1b0a88894
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=69112d7e9715c01f5276b2fb5c31f7aab6aaeef9
Log:
Fixed runtime php.ini override, ini name length is off by 1.
(cherry picked from commit 5bcb7a7019a49c2f80eda7d2aa947efebeee0034)
Changed paths:
M sapi/litespeed/lsapi_main.c
Diff:
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 5b79928..b0ea105 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -602,11 +602,12 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int
va
else
{
#if PHP_MAJOR_VERSION >= 7
- psKey = zend_string_init(pKey, keyLen, 1);
+ --keyLen;
+ psKey = zend_string_init(pKey, keyLen, 1);
zend_alter_ini_entry_chars(psKey,
(char *)pValue, valLen,
type, PHP_INI_STAGE_ACTIVATE);
- zend_string_release(psKey);
+ zend_string_release(psKey);
#else
zend_alter_ini_entry((char *)pKey, keyLen,
(char *)pValue, valLen,