]> granicus.if.org Git - php/commitdiff
Fixed bug #76947 file_put_contents() blocks the directory of the file (__DIR__)
authorAnatol Belski <ab@php.net>
Tue, 2 Oct 2018 22:15:43 +0000 (00:15 +0200)
committerAnatol Belski <ab@php.net>
Tue, 2 Oct 2018 22:15:43 +0000 (00:15 +0200)
The condition was wrong. The target buffer size only matters, when some
output is going to be copied into it.

win32/ioutil.h

index 2a396f67b617a596f75b6c4eb8fc8f1114288811..0578584fe0311ef1f09ac62f12fde33ab829711e 100644 (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);