find: Prevent hang by properly checking for EOF.

Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Fabian Maurer 2019-11-01 16:02:41 +01:00 committed by Alexandre Julliard
parent d7533e28df
commit 93c98111ae
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ static BOOL read_char_from_handle(HANDLE handle, char *char_out)
if (buffer_pos >= buffer_max)
{
BOOL success = ReadFile(handle, buffer, 4096, &buffer_max, NULL);
if (!success)
if (!success || !buffer_max)
return FALSE;
buffer_pos = 0;
}