]> 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)
committerGeorge Wang <gwang@php.net>
Thu, 19 Nov 2015 22:01:26 +0000 (17:01 -0500)
sapi/litespeed/lsapi_main.c

index 13bca0cab3f0a0044d8169ce3b195be75f775f45..a296261e1ada9bed09a34d8392dc8bf6487b3159 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,