[PATCH] find: Prevent hang by properly checking for EOF
Fabian Maurer
dark.shadow4 at web.de
Fri Nov 1 10:02:41 CDT 2019
Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
---
programs/find/find.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/find/find.c b/programs/find/find.c
index 3794a8190f..34ca2801eb 100644
--- a/programs/find/find.c
+++ b/programs/find/find.c
@@ -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;
}
--
2.23.0
More information about the wine-devel
mailing list