diff options
author | Pierre Joye <pajoye@php.net> | 2011-01-19 14:21:46 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2011-01-19 14:21:46 +0000 |
commit | 458ce08ab3b72186d8c2e9d6c03d6358f9fb7508 (patch) | |
tree | 97d656594725c3fcfc45d5682fb9f340fcbf4b83 | |
parent | 86550a9fed27d1202bc578d0482195935615255a (diff) | |
download | php-git-458ce08ab3b72186d8c2e9d6c03d6358f9fb7508.tar.gz |
- path len check and fix buffer overrun
-rw-r--r-- | main/php_ini.c | 5 |
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 |