com php-src: Fixed bug #76947 file_put_contents() blo cks the directory of the file (__DIR__) : win32/ioutil.h
| From: | Anatol Belski | Date: | Tue, 02 Oct 2018 22:15:43 +0000 |
| Subject: | com php-src: Fixed bug #76947 file_put_contents() blo cks the directory of the file (__DIR__) : win32/ioutil.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103311@lists.php.net to get a copy of this message | ||
Commit: 8209a8821cc934f81ffaa46dd8b0d0f2f546211f
Author: Anatol Belski <ab@php.net> Wed, 3 Oct 2018 00:15:43 +0200
Parents: a42801abe3542be7fcb6ce46d1533e4cd4e5c612
Branches: PHP-7.3 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8209a8821cc934f81ffaa46dd8b0d0f2f546211f
Log:
Fixed bug #76947 file_put_contents() blocks the directory of the file (__DIR__)
The condition was wrong. The target buffer size only matters, when some
output is going to be copied into it.
Bugs:
https://bugs.php.net/76947
Changed paths:
M win32/ioutil.h
Diff:
diff --git a/win32/ioutil.h b/win32/ioutil..h
index 2a396f6..0578584 100644
--- a/win32/ioutil.h
+++ b/win32/ioutil.h
@@ -481,11 +481,6 @@ __forceinline static char *php_win32_ioutil_getcwd(char *buf, size_t len)
size_t tmp_bufa_len;
DWORD err = 0;
- if (len > PHP_WIN32_IOUTIL_MAXPATHLEN) {
- SET_ERRNO_FROM_WIN32_CODE(ERROR_BAD_LENGTH);
- return NULL;
- }
-
if (php_win32_ioutil_getcwd_w(tmp_bufw, len ? len : PHP_WIN32_IOUTIL_MAXPATHLEN) == NULL) {
err = GetLastError();
SET_ERRNO_FROM_WIN32_CODE(err);