summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-01-17 14:29:16 +0000
committerPierre Joye <pajoye@php.net>2011-01-17 14:29:16 +0000
commit52aa5735f17a5505a5f24bfd3a196bcabe6cae9a (patch)
tree2d76caa5528f7f4499ef12faacd49498df431d7d
parenta1b2df31d6d7c2e724d2190e1ec0f5b728211529 (diff)
downloadphp-git-52aa5735f17a5505a5f24bfd3a196bcabe6cae9a.tar.gz
- path len sanity check
-rw-r--r--main/php_ini.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/php_ini.c b/main/php_ini.c
index 70f2ae7b8e..e71e7f00e2 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -820,6 +820,10 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len TSRMLS_DC)
#if PHP_WIN32
char path_bak[MAXPATHLEN];
+
+ if (path_len > MAXPATHLEN) {
+ return;
+ }
memcpy(path_bak, path, path_len);
path_bak[path_len] = 0;
TRANSLATE_SLASHES_LOWER(path_bak);