]> granicus.if.org Git - php/commitdiff
Fixed runtime php.ini override, ini name length is off by 1.
authorGeorge Wang <gwang@php.net>
Thu, 19 Nov 2015 22:01:26 +0000 (17:01 -0500)
committerLior Kaplan <kaplanlior@gmail.com>
Tue, 5 Jan 2016 21:48:42 +0000 (23:48 +0200)
(cherry picked from commit 5bcb7a7019a49c2f80eda7d2aa947efebeee0034)

sapi/litespeed/lsapi_main.c

index 5b799285334dc54cf2ff3a66ac2b51a7c703cd14..b0ea105a8855f803976fdb3f4d058fb6d71a7ede 100644 (file)
@@ -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,