Skip to content

Commit

Permalink
- path len check and fix buffer overrun
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrejoye committed Jan 19, 2011
1 parent 86550a9 commit 458ce08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main/php_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 458ce08

Please sign in to comment.