mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: fix possible out of bounds buffer access
This commit is contained in:
commit
3438e62b30
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user