Sebastian Lackner : ntdll: Make sure buffer allocated in get_cached_dir_data is big enough for returned entry.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 3 11:15:33 CDT 2016


Module: wine
Branch: master
Commit: f4f33686cb83757dd62353a256e5501ff01b034d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f4f33686cb83757dd62353a256e5501ff01b034d

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Tue May  3 02:16:54 2016 +0200

ntdll: Make sure buffer allocated in get_cached_dir_data is big enough for returned entry.

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/directory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index f7fa951..38cabaf 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2302,7 +2302,7 @@ static NTSTATUS get_cached_dir_data( HANDLE handle, struct dir_data **data_ret,
 
     if (entry >= dir_data_cache_size)
     {
-        unsigned int size = max( dir_data_cache_initial_size, dir_data_cache_size * 2 );
+        unsigned int size = max( dir_data_cache_initial_size, max( dir_data_cache_size * 2, entry + 1 ) );
         struct dir_data **new_cache;
 
         if (dir_data_cache)




More information about the wine-cvs mailing list