Skip to content

Commit 560e339

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #21410 (fixed handling of NULL or "" files on Win32)
1 parent 4cac013 commit 560e339

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/standard/filestat.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
564564
char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev",
565565
"size", "atime", "mtime", "ctime", "blksize", "blocks"};
566566

567+
if (!filename_length) {
568+
RETURN_FALSE;
569+
}
570+
567571
if (PG(safe_mode) &&(!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, IS_EXISTS_CHECK(type) ? CHECKUID_NO_ERRORS : 0))) {
568572
RETURN_FALSE;
569573
}

0 commit comments

Comments
 (0)