From 8209a8821cc934f81ffaa46dd8b0d0f2f546211f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 3 Oct 2018 00:15:43 +0200 Subject: [PATCH] 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. --- win32/ioutil.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/win32/ioutil.h b/win32/ioutil.h index 2a396f67b6..0578584fe0 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); -- 2.50.0