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 | 434f3654dac9ee915a5b4f0a4dbc384d33e1d38c (patch) | |
tree | e2bcb6cdf7ab7c47d21af3f975d20ba131c0acf1 /main/php_ini.c | |
parent | e0c1332537a1a96383c66892d76be0941a2b188c (diff) | |
download | php-git-434f3654dac9ee915a5b4f0a4dbc384d33e1d38c.tar.gz |
- path len check and fix buffer overrun
Diffstat (limited to 'main/php_ini.c')
-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 c842532834..5b13adb258 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -824,12 +824,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 |