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

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-05-03 02:16:54 +02:00 committed by Alexandre Julliard
parent 78d9a85054
commit f4f33686cb

View File

@ -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)