com php-src: fix buffer overrun: main/php_ini.c
| From: | Anatol Belski | Date: | Mon, 15 Jul 2013 15:34:36 +0000 |
| Subject: | com php-src: fix buffer overrun: main/php_ini.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72663@lists.php.net to get a copy of this message | ||
Commit: 9561e598a0b0abfa6f41550830791a5350a1f837
Author: Anatol Belski <ab@php.net> Mon, 15 Jul 2013 17:34:36 +0200
Parents: e617679c0ba616551df62ad370a70d5cf610c270
Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9561e598a0b0abfa6f41550830791a5350a1f837
Log:
fix buffer overrun
Changed paths:
M main/php_ini.c
Diff:
diff --git a/main/php_ini..c b/main/php_ini.c
index bceb6e5..444b4ce 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -785,7 +785,12 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len
TSRMLS_DC)
char path_bak[MAXPATHLEN];
#endif
+#if PHP_WIN32
+ /* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */
+ if (path_len >= MAXPATHLEN) {
+#else
if (path_len > MAXPATHLEN) {
+#endif
return;
}