diff options
author | Anatol Belski <ab@php.net> | 2017-04-03 15:20:32 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2017-04-03 15:20:32 +0200 |
commit | feeb35e438db36f08bb82d493b11d4211201f23c (patch) | |
tree | ca1305c12a4f3e80b2e4189090b1ffa583fe770b | |
parent | 670041b60ec25e822564d337bae96e82e8d9ac89 (diff) | |
download | php-git-feeb35e438db36f08bb82d493b11d4211201f23c.tar.gz |
fix possible out of bounds buffer access
-rw-r--r-- | Zend/zend_virtual_cwd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index ca19802ff7..8009f2f3fd 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -380,7 +380,7 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{ if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { size_t len = strlen(path); - if (path[len-4] == '.') { + if (len >= 4 && path[len-4] == '.') { if (_memicmp(path+len-3, "exe", 3) == 0 || _memicmp(path+len-3, "com", 3) == 0 || _memicmp(path+len-3, "bat", 3) == 0 || |