Skip to content

Commit 8209a88

Browse files
committed
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.
1 parent a42801a commit 8209a88

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

win32/ioutil.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,6 @@ __forceinline static char *php_win32_ioutil_getcwd(char *buf, size_t len)
481481
size_t tmp_bufa_len;
482482
DWORD err = 0;
483483

484-
if (len > PHP_WIN32_IOUTIL_MAXPATHLEN) {
485-
SET_ERRNO_FROM_WIN32_CODE(ERROR_BAD_LENGTH);
486-
return NULL;
487-
}
488-
489484
if (php_win32_ioutil_getcwd_w(tmp_bufw, len ? len : PHP_WIN32_IOUTIL_MAXPATHLEN) == NULL) {
490485
err = GetLastError();
491486
SET_ERRNO_FROM_WIN32_CODE(err);

0 commit comments

Comments
 (0)