Skip to content

Commit 9561e59

Browse files
committed
fix buffer overrun
1 parent e617679 commit 9561e59

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
@@ -785,7 +785,12 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len TSRMLS_DC)
785785
char path_bak[MAXPATHLEN];
786786
#endif
787787

788+
#if PHP_WIN32
789+
/* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */
790+
if (path_len >= MAXPATHLEN) {
791+
#else
788792
if (path_len > MAXPATHLEN) {
793+
#endif
789794
return;
790795
}
791796

0 commit comments

Comments
 (0)