summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-01-19 14:21:46 +0000
committerPierre Joye <pajoye@php.net>2011-01-19 14:21:46 +0000
commit458ce08ab3b72186d8c2e9d6c03d6358f9fb7508 (patch)
tree97d656594725c3fcfc45d5682fb9f340fcbf4b83
parent86550a9fed27d1202bc578d0482195935615255a (diff)
downloadphp-git-458ce08ab3b72186d8c2e9d6c03d6358f9fb7508.tar.gz
- path len check and fix buffer overrun
-rw-r--r--main/php_ini.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/php_ini.c b/main/php_ini.c
index e71e7f00e2..8ad7362bba 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -820,12 +820,15 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len TSRMLS_DC)
#if PHP_WIN32
char path_bak[MAXPATHLEN];
+#endif
if (path_len > MAXPATHLEN) {
return;
}
+
+#if PHP_WIN32
memcpy(path_bak, path, path_len);
- path_bak[path_len] = 0;
+ path_bak[path_len - 1] = 0;
TRANSLATE_SLASHES_LOWER(path_bak);
path = path_bak;
#endif