Permalink
Browse files

- path len check and fix buffer overrun

  • Loading branch information...
1 parent 86550a9 commit 458ce08ab3b72186d8c2e9d6c03d6358f9fb7508 @pierrejoye pierrejoye committed Jan 19, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 main/php_ini.c
View
5 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

0 comments on commit 458ce08

Please sign in to comment.