diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-08-17 17:14:30 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-08-17 17:14:30 +0800 |
commit | ce6ad9bdd96dd3702ef248e5e364400402620dbc (patch) | |
tree | e4568a0b9239c67999fccb6f75f935a37419f5c7 /main | |
parent | e47773b6266a8bb6d39af7f3ed5630c4698c2f76 (diff) | |
parent | 1dab8e07f2e14221f534202e7d0c03600b3259eb (diff) | |
download | php-git-ce6ad9bdd96dd3702ef248e5e364400402620dbc.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: (48 commits)
Update NEWs
Unused label
Fixed bug #72853 (stream_set_blocking doesn't work)
fix test
Bug #72663 - part 3
Bug #72663 - part 2
Bug #72663 - part 1
Update NEWS
BLock test with memory leak
fix tests
Fix TSRM build
Fix bug #72850 - integer overflow in uuencode
Fixed bug #72849 - integer overflow in urlencode
Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption
Fix bug #72838 - Integer overflow lead to heap corruption in sql_regcase
Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
Fix bug #72836 - integer overflow in base64_decode caused heap corruption
Fix for bug #72807 - do not produce strings with negative length
Fix for bug #72790 and bug #72799
Fix bug #72730 - imagegammacorrect allows arbitrary write access
...
Conflicts:
ext/standard/var_unserializer.c
Diffstat (limited to 'main')
-rw-r--r-- | main/fopen_wrappers.c | 6 | ||||
-rw-r--r-- | main/streams/plain_wrapper.c | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index c3646ee0fd..bf78db3bdf 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -144,7 +144,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path char *path_file; int resolved_basedir_len; int resolved_name_len; - int path_len; + size_t path_len; int nesting_level = 0; /* Special case basedir==".": Use script-directory */ @@ -153,7 +153,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path strlcpy(local_open_basedir, basedir, sizeof(local_open_basedir)); } - path_len = (int)strlen(path); + path_len = strlen(path); if (path_len > (MAXPATHLEN - 1)) { /* empty and too long paths are invalid */ return -1; @@ -164,7 +164,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path return -1; } - path_len = (int)strlen(resolved_name); + path_len = strlen(resolved_name); memcpy(path_tmp, resolved_name, path_len + 1); /* safe */ while (VCWD_REALPATH(path_tmp, resolved_name) == NULL) { diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 7ede3718b5..69dd25acc5 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -857,7 +857,19 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void data->is_pipe_blocking = value; return PHP_STREAM_OPTION_RETURN_OK; #endif + case PHP_STREAM_OPTION_META_DATA_API: + if (fd == -1) + return -1; +#ifdef O_NONBLOCK + flags = fcntl(fd, F_GETFL, 0); + add_assoc_bool((zval*)ptrparam, "timed_out", 0); + add_assoc_bool((zval*)ptrparam, "blocked", (flags & O_NONBLOCK)? 0 : 1); + add_assoc_bool((zval*)ptrparam, "eof", stream->eof); + + return PHP_STREAM_OPTION_RETURN_OK; +#endif + return -1; default: return PHP_STREAM_OPTION_RETURN_NOTIMPL; } |