Skip to content

Commit fb91fc6

Browse files
committed
Merge branch 'PHP-5.5'
* PHP-5.5: fix buffer overrun
2 parents af377da + e7a4cf8 commit fb91fc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/php_ini.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,12 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len TSRMLS_DC)
802802
char path_bak[MAXPATHLEN];
803803
#endif
804804

805+
#if PHP_WIN32
806+
/* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */
807+
if (path_len >= MAXPATHLEN) {
808+
#else
805809
if (path_len > MAXPATHLEN) {
810+
#endif
806811
return;
807812
}
808813

0 commit comments

Comments
 (0)