From: Christoph M. Becker Date: Thu, 23 Jul 2015 12:11:28 +0000 (+0200) Subject: Fix #36365: scandir duplicates file name at every 65535th file X-Git-Tag: php-7.0.0beta3~5^2~88^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e8f01cb6e75e09ad7ffa5201c42d1bea2a61264;p=php Fix #36365: scandir duplicates file name at every 65535th file Due to DIR.offset being declared as short we have an overflow. This patch changes the field to int. --- diff --git a/win32/readdir.h b/win32/readdir.h index f1fb3a736f..d9ae477af0 100644 --- a/win32/readdir.h +++ b/win32/readdir.h @@ -32,7 +32,7 @@ struct dirent { /* typedef DIR - not the same as Unix */ typedef struct { HANDLE handle; /* _findfirst/_findnext handle */ - short offset; /* offset into directory */ + int offset; /* offset into directory */ short finished; /* 1 if there are not more files */ WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */ char *dir; /* the dir we are reading */