From: George Wang Date: Thu, 19 Nov 2015 22:01:26 +0000 (-0500) Subject: Fixed runtime php.ini override, ini name length is off by 1. X-Git-Tag: php-7.1.0alpha1~709 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bcb7a7019a49c2f80eda7d2aa947efebeee0034;p=php Fixed runtime php.ini override, ini name length is off by 1. --- diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 13bca0cab3..a296261e1a 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,