summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2003-10-19 13:47:35 +0000
committerStanislav Malyshev <stas@php.net>2003-10-19 13:47:35 +0000
commite8e0c6fb41d375884582adca13edf67a7052058e (patch)
tree5daf9d07aa78a015de50e555cd607c346e476093
parent06aae4bd9c806774e2447071f4e5d845d4a90ad5 (diff)
downloadphp-git-e8e0c6fb41d375884582adca13edf67a7052058e.tar.gz
fix wrong string length for registry values
-rw-r--r--win32/registry.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win32/registry.c b/win32/registry.c
index c9a324b628..6eda0f9fff 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -72,7 +72,8 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC)
RegEnumValue(hKey, i, namebuf, &namebuf_len, NULL, &lType, valuebuf, &valuebuf_len);
if ((lType == REG_SZ) || (lType == REG_EXPAND_SZ)) {
- zend_alter_ini_entry(namebuf, namebuf_len + 1, valuebuf, valuebuf_len, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+ /* valuebuf_len includes trailing 0 */
+ zend_alter_ini_entry(namebuf, namebuf_len + 1, valuebuf, valuebuf_len?valuebuf_len-1:0, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
}
i++;