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.
This commit is contained in:
Anatol Belski 2018-10-03 00:15:43 +02:00
parent a42801abe3
commit 8209a8821c

View File

@ -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);