mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
fix possible out of bounds buffer access
This commit is contained in:
parent
670041b60e
commit
feeb35e438
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
|
||||||
size_t len = strlen(path);
|
size_t len = strlen(path);
|
||||||
|
|
||||||
if (path[len-4] == '.') {
|
if (len >= 4 && path[len-4] == '.') {
|
||||||
if (_memicmp(path+len-3, "exe", 3) == 0 ||
|
if (_memicmp(path+len-3, "exe", 3) == 0 ||
|
||||||
_memicmp(path+len-3, "com", 3) == 0 ||
|
_memicmp(path+len-3, "com", 3) == 0 ||
|
||||||
_memicmp(path+len-3, "bat", 3) == 0 ||
|
_memicmp(path+len-3, "bat", 3) == 0 ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue