summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-04-23 14:49:26 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-04-24 09:47:56 +0200
commit767a77ac19af1192aa8b674d62f75b08abb199d6 (patch)
tree7b3d49538ecbfe6922c80b62d47ec3b9005ac1f9 /win32
parent41a04f96b487e642f3c046636f13412d95759b17 (diff)
downloadphp-git-767a77ac19af1192aa8b674d62f75b08abb199d6.tar.gz
Fix #36365: scandir duplicates file name at every 65535th file
Since DIR_W32.offset is declared as `uint16_t`, we have an overflow for directories with many entries. This patch changes the field to `uint32_t`.
Diffstat (limited to 'win32')
-rw-r--r--win32/readdir.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/readdir.h b/win32/readdir.h
index 61876f3dc1..cc8e1a9a25 100644
--- a/win32/readdir.h
+++ b/win32/readdir.h
@@ -26,7 +26,7 @@ struct dirent {
/* typedef DIR - not the same as Unix */
struct DIR_W32 {
HANDLE handle; /* _findfirst/_findnext handle */
- uint16_t offset; /* offset into directory */
+ uint32_t offset; /* offset into directory */
uint8_t finished; /* 1 if there are not more files */
WIN32_FIND_DATAW fileinfo; /* from _findfirst/_findnext */
wchar_t *dirw; /* the dir we are reading */